aboutsummaryrefslogtreecommitdiff
path: root/ft_strcmp.c
blob: 8a86b2afb011781f02fb5205bbc5b9595fe835b1 (plain)
1
2
3
4
5
6
7
8
9
int ft_strcmp(const char *s1, const char *s2)
{
    int i;

    i = 0;
    while (s1[i] && s2[i] && s1[i] == s2[i])
        i++;
    return ((unsigned char)s1[i] - (unsigned char)s2[i]);
}