From cee614bbd12652f920b6cd299ac7ca5dba93525f 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. --- 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.40.0