From: solar Date: Mon, 24 Jul 2006 08:41:11 +0000 (+0000) Subject: Fixed end-of-string bug. Thanks to Paul Barker for reporting this. X-Git-Tag: v0.5~143 X-Git-Url: https://pd.if.org/git/?p=pdclib;a=commitdiff_plain;h=cee614bbd12652f920b6cd299ac7ca5dba93525f Fixed end-of-string bug. Thanks to Paul Barker for reporting this. --- diff --git a/functions/string/strncmp.c b/functions/string/strncmp.c index cbd16e4..0d1e7f0 100644 --- a/functions/string/strncmp.c +++ b/functions/string/strncmp.c @@ -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;