From 07f827f6957bfb9b3c29f8730670bf1ed51581ff Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Fri, 30 May 2008 21:05:23 -0500 Subject: [PATCH] Fix stupid strncmp() bug. Signed-off-by: Scott Wood --- lib/c/freestanding/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/c/freestanding/string.c b/lib/c/freestanding/string.c index 04cd22a..45eb246 100644 --- a/lib/c/freestanding/string.c +++ b/lib/c/freestanding/string.c @@ -163,7 +163,7 @@ int strncmp(const char *s1, const char *s2, int n) if (i == n) return 0; - return (unsigned char)*s2 - (unsigned char)*s1; + return (unsigned char)s2[i] - (unsigned char)s1[i]; } char *strchr(const char *s, int c) -- 2.39.2