]> pd.if.org Git - pdclib/commitdiff
Fixed end-of-string bug. Thanks to Paul Barker for reporting this.
authorsolar <unknown>
Mon, 24 Jul 2006 08:41:11 +0000 (08:41 +0000)
committersolar <unknown>
Mon, 24 Jul 2006 08:41:11 +0000 (08:41 +0000)
functions/string/strncmp.c

index cbd16e4fe83ab305ad550f1ecd5ac5acca5b545e..0d1e7f036922c963df4e0dfc1420e3510fd82f43 100644 (file)
@@ -12,7 +12,7 @@
 
 int strncmp( const char * s1, const char * s2, size_t n )
 {
-    while ( n && ( *s1 == *s2 ) )
+    while ( n && *s1 && ( *s1 == *s2 ) )
     {
         ++s1;
         ++s2;