summaryrefslogtreecommitdiff
path: root/lib/strndup.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-09-13 22:01:20 +0000
committerJim Meyering <jim@meyering.net>2003-09-13 22:01:20 +0000
commitdce9582d2ca06a6c50165014b21d95654541e8da (patch)
treea44364d0664dbc9f44ba1ed449b6e1fe9c1a7808 /lib/strndup.c
parent2be39af412edc53d4ef09097949550697c270173 (diff)
downloadcoreutils-dce9582d2ca06a6c50165014b21d95654541e8da.tar.xz
Update from gnulib.
Diffstat (limited to 'lib/strndup.c')
-rw-r--r--lib/strndup.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/strndup.c b/lib/strndup.c
index 136e51c73..f85627e87 100644
--- a/lib/strndup.c
+++ b/lib/strndup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -21,15 +21,8 @@
# include "config.h"
#endif
-#include <stdio.h>
-#include <sys/types.h>
-
-#if defined _LIBC || defined STDC_HEADERS
-# include <stdlib.h>
-# include <string.h>
-#else
-char *malloc ();
-#endif
+#include <stdlib.h>
+#include <string.h>
#ifndef HAVE_DECL_STRNLEN
"this configure-time declaration test was not run"
@@ -55,7 +48,7 @@ __strndup (const char *s, size_t n)
return NULL;
new[len] = '\0';
- return (char *) memcpy (new, s, len);
+ return memcpy (new, s, len);
}
#ifdef weak_alias
weak_alias (__strndup, strndup)