skeletton untested project

This commit is contained in:
thrieg 2025-12-11 06:18:16 +01:00
commit 6fc620e8f4
187 changed files with 6584 additions and 0 deletions

31
libft/ft_memcmp.c Executable file
View file

@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/14 17:39:59 by thrieg #+# #+# */
/* Updated: 2025/02/16 19:04:06 by thrieg ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_memcmp(const void *s1, const void *s2, size_t n)
{
const unsigned char *st1;
const unsigned char *st2;
st1 = (const unsigned char *)s1;
st2 = (const unsigned char *)s2;
while (n && (*st1 == *st2))
{
st1++;
st2++;
n--;
}
if (n == 0)
return (0);
return (*st1 - *st2);
}