28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strnequ.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gbrochar <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2015/11/29 08:37:07 by gbrochar #+# #+# */
|
|
/* Updated: 2015/12/05 16:24:50 by gbrochar ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
int ft_strnequ(char const *s1, char const *s2, size_t n)
|
|
{
|
|
size_t i;
|
|
|
|
i = 0;
|
|
while (s1[i] == s2[i] || i == n)
|
|
{
|
|
if ((s1[i] == '\0' && s2[i] == '\0') || i == n)
|
|
return (1);
|
|
i++;
|
|
}
|
|
return (0);
|
|
}
|