From 9114fccb27d817ba18918a84524e6e8b1998f361 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 29 Oct 2006 02:42:08 +0100 Subject: [PATCH] we don't use strdup in mutt sources anymore, remove that compat file --- configure.in | 2 +- makedoc.c | 4 ++-- strdup.c | 27 --------------------------- 3 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 strdup.c diff --git a/configure.in b/configure.in index ed0ea67..2fad06b 100644 --- a/configure.in +++ b/configure.in @@ -326,7 +326,7 @@ AC_TYPE_PID_T dnl AC_CHECK_TYPE(ssize_t, int) AC_CHECK_FUNCS(fgetpos memmove setegid srand48 strerror) -AC_REPLACE_FUNCS(strcasecmp strdup setenv) +AC_REPLACE_FUNCS(strcasecmp setenv) AC_CHECK_FUNCS(snprintf vsnprintf) AC_CHECK_FUNC(getopt) diff --git a/makedoc.c b/makedoc.c index 29fa8f8..f5e85cf 100644 --- a/makedoc.c +++ b/makedoc.c @@ -191,7 +191,7 @@ static void add_var (const char *name) { outbuf = realloc (outbuf, (++outcount) * sizeof (var_t)); outbuf[outcount - 1].seen = 0; - outbuf[outcount - 1].name = strdup (name); + outbuf[outcount - 1].name = p_strdup(name, str_len(name)); outbuf[outcount - 1].descr = NULL; } @@ -207,7 +207,7 @@ static int add_s (const char *s) } if (lold == 0) - outbuf[outcount - 1].descr = strdup (s); + outbuf[outcount - 1].descr = p_strdup(s, str_len(s)); else { outbuf[outcount - 1].descr = realloc (outbuf[outcount - 1].descr, lold + lnew + 1); diff --git a/strdup.c b/strdup.c deleted file mode 100644 index 9920a4a..0000000 --- a/strdup.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright notice from original mutt: - * [none] - * - * This file is part of mutt-ng, see http://www.muttng.org/. - * It's licensed under the GNU General Public License, - * please see the file GPL in the top level source directory. - */ - -/* ultrix doesn't have strdup */ - -#include -#include - -char *strdup (const char *s) -{ /* __MEM_CHECKED__ */ - char *d; - - if (s == NULL) - return NULL; - - if ((d = malloc (str_len (s) + 1)) == NULL) /* __MEM_CHECKED__ */ - return NULL; - - memcpy (d, s, str_len (s) + 1); - return d; -} -- 2.20.1