summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-07-01 16:32:03 +0000
committerRoland McGrath <roland@gnu.org>1996-07-01 16:32:03 +0000
commit635eb0b5f5a7d83e3c06ee43096b958ce6d84e45 (patch)
treed4941a71686af0451d158d0b7792547a3f53787d
parent2baf7c31ad59f41a3df69e9dcf7025fb3b5d071f (diff)
Sat Jun 29 00:02:11 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* string/strndup.c (strndup): Properly terminate the new string; add missing second argument to strnlen. * string/string.h (strndupa): Likewise.
-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)