-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strcmp.c
28 lines (25 loc) · 1.07 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: bdomansk <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/06 16:06:16 by bdomansk #+# #+# */
/* Updated: 2017/11/06 16:15:17 by bdomansk ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_strcmp(const char *s1, const char *s2)
{
unsigned char t1;
unsigned char t2;
while (*s1 == *s2 && *s1 != 0)
{
s1++;
s2++;
}
t1 = *s1;
t2 = *s2;
return (t1 - t2);
}