diff options
Diffstat (limited to 'libft/src/ft_strnlen.c')
-rw-r--r-- | libft/src/ft_strnlen.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libft/src/ft_strnlen.c b/libft/src/ft_strnlen.c index 325fa0d..f51989b 100644 --- a/libft/src/ft_strnlen.c +++ b/libft/src/ft_strnlen.c @@ -12,12 +12,11 @@ #include <stddef.h> -size_t - ft_strnlen(const char *s, size_t size) +size_t ft_strnlen(const char *s, size_t size) { const char *ptr = s; - while (size > 0 && *ptr) + while (size > 0 && *ptr != '\0') { size--; ptr++; |