-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcmp.c
28 lines (26 loc) · 1.11 KB
/
ft_strcmp.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: alaulom <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/05 10:49:54 by alaulom #+# #+# */
/* Updated: 2015/12/14 15:17:21 by alaulom ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strcmp(const char *s1, const char *s2)
{
unsigned char *us1;
unsigned char *us2;
us1 = (unsigned char *)s1;
us2 = (unsigned char *)s2;
while (*us1)
{
if (*us1 != *us2)
return (*us1 - *us2);
us1++;
us2++;
}
return (0);
}