copy on git

This commit is contained in:
Thomas Rieg 2025-11-28 19:50:58 +01:00
commit 42653de246
205 changed files with 7459 additions and 0 deletions

26
libft/ft_strncmp.c Executable file
View file

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