summaryrefslogtreecommitdiffstats
path: root/libft/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libft/src/ft_strclen.c (renamed from src/ft_b_unset.c)24
-rw-r--r--libft/src/ft_strlen.c2
2 files changed, 13 insertions, 13 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);
}
diff --git a/libft/src/ft_strlen.c b/libft/src/ft_strlen.c
index 90f5110..2b26bf0 100644
--- a/libft/src/ft_strlen.c
+++ b/libft/src/ft_strlen.c
@@ -18,7 +18,7 @@ size_t
const char *ptr;
ptr = s;
- while (ptr && *ptr)
+ while (ptr != NULL && *ptr != '\0')
ptr++;
return (ptr - s);
}