X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstrndup.c;h=f85627e879d2f4f891060b0171f63924161068e1;hb=cbb86267fda18ba3e409e16cf9c460cbbed1846c;hp=136e51c736d4c8656cd2ab3f11767028a876e554;hpb=239b989f79d7cc4497ba922d5e40021851c9cf90;p=gnulib.git 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 -#include - -#if defined _LIBC || defined STDC_HEADERS -# include -# include -#else -char *malloc (); -#endif +#include +#include #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)