about summary refs log tree commit diff
path: root/string/test-strncmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/test-strncmp.c')
-rw-r--r--string/test-strncmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string/test-strncmp.c b/string/test-strncmp.c
index 8881909646..2c49e576d6 100644
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@ -42,7 +42,7 @@ simple_strncmp (const char *s1, const char *s2, size_t n)
 int
 stupid_strncmp (const char *s1, const char *s2, size_t n)
 {
-  size_t ns1 = strlen (s1) + 1, ns2 = strlen (s2) + 1;
+  size_t ns1 = strnlen (s1, n) + 1, ns2 = strnlen (s2, n) + 1;
   int ret = 0;
 
   n = ns1 < n ? ns1 : n;