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-Url: https://pd.if.org/git/?p=pdclib.old;a=commitdiff_plain;h=719aa6fe1c78c9ad9400aad06924ac6acb606746 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;