kern

diff src/klibc/string.c @ 67:ebca81749ef5

added strcmp
author John Tsiombikas <nuclear@mutantstargoat.com>
date Sun, 09 Oct 2011 20:38:35 +0300
parents af6f4adc43d6
children f83f50c17c3b
line diff
     1.1 --- a/src/klibc/string.c	Thu Oct 06 04:28:21 2011 +0300
     1.2 +++ b/src/klibc/string.c	Sun Oct 09 20:38:35 2011 +0300
     1.3 @@ -88,3 +88,12 @@
     1.4  	}
     1.5  	return 0;
     1.6  }
     1.7 +
     1.8 +int strcmp(const char *s1, const char *s2)
     1.9 +{
    1.10 +	while(*s1 && *s1 == *s2) {
    1.11 +		s1++;
    1.12 +		s2++;
    1.13 +	}
    1.14 +	return *s1 - *s2;
    1.15 +}