summary refs log tree commit diff
path: root/string/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'string/string.h')
-rw-r--r--string/string.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/string/string.h b/string/string.h
index 7dbcc41c22..da26a6f496 100644
--- a/string/string.h
+++ b/string/string.h
@@ -108,7 +108,7 @@ extern char *strndup __P ((__const char *__string, size_t __n));
 ({									      \
   __const char *__old = (s);						      \
   char *__new;								      \
-  size_t __len = strnlen (__old);					      \
+  size_t __len = strnlen (__old, (n));					      \
   __new = memcpy (__builtin_alloca (__len + 1), __old, __len);		      \
   __new[__len] = '\0';							      \
   __new;								      \