summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/string.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/string.h b/src/include/string.h
index b862194979..125c676128 100644
--- a/src/include/string.h
+++ b/src/include/string.h
@@ -112,7 +112,7 @@ static inline int strncmp(const char *s1, const char *s2, int maxlen)
int i;
for (i = 0; i < maxlen; i++) {
- if (s1[i] != s2[i])
+ if ((s1[i] != s2[i]) || (s1[i] == '\0'))
return s1[i] - s2[i];
}