From c07b2f43477604e8cad41b8914f97b9da9f10e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Wed, 22 Oct 2025 19:02:48 +0200 Subject: [PATCH] fix(ft_memcmp): update `int` to `size_t` and comply to 42 norm --- ft_memcmp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ft_memcmp.c b/ft_memcmp.c index a5efbaa..5fe0fb4 100644 --- a/ft_memcmp.c +++ b/ft_memcmp.c @@ -1,16 +1,18 @@ #include "libft.h" +#include int ft_memcmp(const void *s1, const void *s2, size_t n) { char *c1; char *c2; - int i; + size_t i; c1 = (char *)s1; c2 = (char *)s2; i = 0; while (i < n && c1[i] == c2[i]) i++; - if (i == n) return (0); + if (i == n) + return (0); return (c1[i] - c2[i]); }