summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_strncmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libft/src/ft_strncmp.c')
-rw-r--r--libft/src/ft_strncmp.c5
1 files changed, 2 insertions, 3 deletions
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 <stddef.h>
-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++;
}