22 lines
1.0 KiB
C
22 lines
1.0 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_strncmp.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/07/18 13:17:50 by cchauvet #+# #+# */
|
||
|
/* Updated: 2022/07/21 12:57:14 by cchauvet ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
int ft_strncmp(char *s1, char *s2, unsigned int n)
|
||
|
{
|
||
|
int i;
|
||
|
|
||
|
i = 0;
|
||
|
while (s1[i] != 0 && s2[i] != 0 && s1[i] == s2[i] && i < n - 1)
|
||
|
i++;
|
||
|
return (s1[i] - s2[i]);
|
||
|
}
|