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://git.gag.com/?a=commitdiff_plain;h=8e383953bbbc2a5a549f924cd8f07d387ff2547f;p=fw%2Fpdclib Fixed end-of-string bug. Thanks to Paul Barker for reporting this. git-svn-id: https://srv7.svn-repos.de/dev34/pdclib/trunk@250 546481bc-9713-0410-bf18-d3337bbf4a3e --- 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;