-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strnequ.c
23 lines (20 loc) · 1.05 KB
/
ft_strnequ.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnequ.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mfebvay <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2013/11/24 23:50:57 by mfebvay #+# #+# */
/* Updated: 2015/01/23 03:23:30 by mfebvay ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
int ft_strnequ(char const *s1, char const *s2, size_t n)
{
size_t i;
i = 0;
while (s1[i] && s1[i] == s2[i] && i < n)
i++;
return (i == n || s1[i] == s2[i]);
}