aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-08-31 04:12:57 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-08-31 04:12:57 +0000
commit76b7c3631ef23d4da727ac001661474a07d2f7f3 (patch)
treebe16767d6292d160346adb7b8a700397d5e744f0
parentdab0d3a353c07cd89914ae324c4ca1108bcb6d4d (diff)
downloadklibc-76b7c3631ef23d4da727ac001661474a07d2f7f3.tar.gz
Fix inverted return value from memcmp/strcmpklibc-0.63
-rw-r--r--klibc/memcmp.c2
-rw-r--r--klibc/strcmp.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/klibc/memcmp.c b/klibc/memcmp.c
index 9dda5a45588bf..f6bc17286f0e4 100644
--- a/klibc/memcmp.c
+++ b/klibc/memcmp.c
@@ -10,7 +10,7 @@ int memcmp(const void *s1, const void *s2, size_t n)
int d = 0;
while ( n-- ) {
- d = (int)*c2++ - (int)*c1++;
+ d = (int)*c1++ - (int)*c2++;
if ( d )
break;
}
diff --git a/klibc/strcmp.c b/klibc/strcmp.c
index d4c17d2207c6d..f44774f4435bf 100644
--- a/klibc/strcmp.c
+++ b/klibc/strcmp.c
@@ -11,7 +11,7 @@ int strcmp(const char *s1, const char *s2)
int d = 0;
while ( 1 ) {
- d = (int)*c2++ - (int)(ch = *c1++);
+ d = (int)(ch = *c1++) - (int)*c2++;
if ( d || !ch )
break;
}