From 635eb0b5f5a7d83e3c06ee43096b958ce6d84e45 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 1 Jul 1996 16:32:03 +0000 Subject: Sat Jun 29 00:02:11 1996 Andreas Schwab * string/strndup.c (strndup): Properly terminate the new string; add missing second argument to strnlen. * string/string.h (strndupa): Likewise. --- string/strndup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string/strndup.c') 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) -- cgit 1.4.1