/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_memcmp.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: aortigos +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/09/22 19:17:43 by aortigos #+# #+# */ /* Updated: 2023/09/22 19:21:07 by aortigos ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" int ft_memcmp(const void *s1, const void *s2, size_t n) { unsigned int i; i = 0; while (i < n) { if (((unsigned char *)s1)[i] != ((unsigned char *)s2)[i]) { return (((unsigned char *)s1)[i] - ((unsigned char *)s2)[i]); } i++; } return (0); }