aboutsummaryrefslogtreecommitdiff
path: root/string/strndup.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/strndup.c')
-rw-r--r--string/strndup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string/strndup.c b/string/strndup.c
index c40d00fc59..8757b869d5 100644
--- a/string/strndup.c
+++ b/string/strndup.c
@@ -24,7 +24,7 @@ Cambridge, MA 02139, USA. */
char *
strndup (const char *s, size_t n)
{
- size_t len = strnlen (s);
+ size_t len = strnlen (s, n);
char *new = malloc (len + 1);
if (new == NULL)