From 8e383953bbbc2a5a549f924cd8f07d387ff2547f Mon Sep 17 00:00:00 2001 From: solar Date: Mon, 24 Jul 2006 08:41:11 +0000 Subject: [PATCH] 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 --- functions/string/strncmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.2