summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_strclen.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-04 15:52:47 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-04 15:52:47 +0200
commit5cb3373a2e5a5109a5d3b72ef45978b98f885706 (patch)
tree11a0a6f467da3ddf227d2eaf6824c4509242025e /libft/src/ft_strclen.c
parentok nice (diff)
parent$? fix (diff)
download42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.gz
42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.bz2
42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.xz
42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.tar.zst
42-minishell-5cb3373a2e5a5109a5d3b72ef45978b98f885706.zip
Merge branch 'master' into fix-pwd
Diffstat (limited to '')
-rw-r--r--libft/src/ft_strclen.c (renamed from src/ft_b_unset.c)24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ft_b_unset.c b/libft/src/ft_strclen.c
index a382aca..fe88ca5 100644
--- a/src/ft_b_unset.c
+++ b/libft/src/ft_strclen.c
@@ -1,24 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
-/* ft_b_unset.c :+: :+: :+: */
+/* ft_strclen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */
-/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */
+/* Created: 2020/02/14 17:07:12 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:07:12 by rbousset ### ########lyon.fr */
/* */
/* ************************************************************************** */
-#include <stdint.h>
-#include "ft_s_struct.h"
+#include <stddef.h>
-uint8_t
- ft_b_unset(char *args[],
- t_msh *msh)
+size_t
+ ft_strclen(const char *s, int c)
{
- (void)args;
- (void)msh;
- /* TODO: do unset */
- return (0);
+ const char *ptr;
+
+ ptr = s;
+ while (ptr != NULL && *ptr != '\0' && *ptr != c)
+ ptr++;
+ return (ptr - s);
}