From 9a915b797a80c2a776027b1fcc37f1e7b8ab1b24 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 29 Sep 2020 19:50:20 +0200 Subject: Update --- libft/src/ft_strnlen.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libft/src/ft_strnlen.c') 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 -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++; -- cgit v1.2.3