-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strequ.c
executable file
·36 lines (32 loc) · 1.2 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
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strequ.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mwilliam <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/09 17:09:46 by mwilliam #+# #+# */
/* Updated: 2016/11/30 14:36:00 by mwilliam ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** Lexicographically compares s1 and s2
*/
int ft_strequ(char const *s1, char const *s2)
{
char const *str1;
char const *str2;
str1 = s1;
str2 = s2;
if (!str1 || !str2)
return (0);
while (*str1 && *str2 && (*str1 == *str2))
{
str1++;
str2++;
}
if (*str1 == *str2)
return (1);
return (0);
}