diff options
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); } |