FIX first part of mandatory functions
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/05 18:00:38 by dgaillet #+# #+# */
|
||||
/* Updated: 2025/11/05 18:05:28 by dgaillet ### ########lyon.fr */
|
||||
/* Updated: 2025/11/06 11:17:32 by dgaillet ### ########lyon.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -16,7 +16,9 @@ int ft_memcmp(const void *s1, const void *s2, size_t n)
|
||||
{
|
||||
if (n <= 0)
|
||||
return (0);
|
||||
if (*((unsigned char *) s1) != *((unsigned char *) s2))
|
||||
return (*((unsigned char *) s1) - *((unsigned char *) s2));
|
||||
if (*(unsigned char *) s1 > *(unsigned char *) s2)
|
||||
return (1);
|
||||
if (*(unsigned char *) s1 < *(unsigned char *) s2)
|
||||
return (-1);
|
||||
return (ft_memcmp(s1 + 1, s2 + 1, n - 1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user