]> git.buserror.net Git - polintos/scott/priv.git/commitdiff
Fix stupid strncmp() bug.
authorScott Wood <scott@thor.buserror.net>
Sat, 31 May 2008 02:05:23 +0000 (21:05 -0500)
committerScott Wood <scott@thor.buserror.net>
Sat, 31 May 2008 02:05:23 +0000 (21:05 -0500)
Signed-off-by: Scott Wood <scott@thor.buserror.net>
lib/c/freestanding/string.c

index 04cd22ac9fc74de01d3cec12c3aa65192996cef1..45eb2463284af43fd33ffe4f043e999dd0069537 100644 (file)
@@ -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)