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_strncmp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libft/src/ft_strncmp.c') diff --git a/libft/src/ft_strncmp.c b/libft/src/ft_strncmp.c index 30a4562..2df9f46 100644 --- a/libft/src/ft_strncmp.c +++ b/libft/src/ft_strncmp.c @@ -12,15 +12,14 @@ #include -int - ft_strncmp(const char *s1, const char *s2, size_t n) +int ft_strncmp(const char *s1, const char *s2, size_t n) { size_t i; i = 0; while (s1[i] == s2[i] && i < n - 1) { - if (!s1[i] && !s2[i]) + if (s1[i] == '\0' && s2[i] == '\0') return (0); i++; } -- cgit v1.2.3