From a3da002108d5418471991b77ec41b0bd0d87f0c0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 11 Sep 2003 08:43:46 +0000 Subject: [PATCH] Remove K&R cruft. --- lib/strndup.c | 15 ++++----------- m4/strndup.m4 | 5 ++--- 2 files changed, 6 insertions(+), 14 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 -#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) diff --git a/m4/strndup.m4 b/m4/strndup.m4 index f2f5cfea6..80dfcc1d9 100644 --- a/m4/strndup.m4 +++ b/m4/strndup.m4 @@ -1,5 +1,5 @@ -# strndup.m4 serial 1 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# strndup.m4 serial 2 +dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program @@ -19,7 +19,6 @@ AC_DEFUN([gl_FUNC_STRNDUP], # Prerequisites of lib/strndup.c. AC_DEFUN([gl_PREREQ_STRNDUP], [ - AC_REQUIRE([AC_HEADER_STDC]) AC_CHECK_DECLS(strnlen) ]) -- 2.11.0