This commit is contained in:
Camille Chauvet
2023-05-17 16:45:25 +00:00
commit 29ed24d567
619 changed files with 16119 additions and 0 deletions

View File

@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jmendez <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/20 14:58:04 by jmendez #+# #+# */
/* Updated: 2022/07/20 15:00:50 by jmendez ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
int ft_strncmp(char *s1, char *s2, unsigned int n)
{
unsigned int i;
i = 0;
while (i < n)
{
if (s1[i] != s2[i] || s1[i] == '\0' || s2[i] == '\0')
{
return (s1[i] - s2[i]);
}
i++;
}
return (0);
}