-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strequ.c
33 lines (31 loc) · 1.17 KB
/
ft_strequ.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strequ.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ybitton <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/28 16:01:49 by ybitton #+# #+# */
/* Updated: 2016/12/15 18:43:51 by ybitton ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_strequ(char const *s1, char const *s2)
{
if (s1 != NULL && s2 != NULL)
{
while ((unsigned char)*s1 || (unsigned char)*s2)
{
if ((unsigned char)*s1 == (unsigned char)*s2)
{
s1++;
s2++;
}
else
return (0);
}
return (1);
}
else
return (0);
}