24 lines
1.1 KiB
C
24 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strncmp.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/09/27 08:30:26 by cchauvet #+# #+# */
|
|
/* Updated: 2022/09/27 08:36:25 by cchauvet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
int strncmp(const char *s1, const char *s2, size_t n)
|
|
{
|
|
size_t i;
|
|
|
|
i = 0;
|
|
while (s1[i] == s2[i] && i < n - 1 && s1[i] && s2[i])
|
|
i++;
|
|
return (s1[i] - s2[i]);
|
|
}
|