X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=strdup.c;h=9920a4acb728326a1ec6b8d32b27a4144a32785a;hp=0249a058f7e994dbf00fc099f29cf5d769ffed42;hb=4b74d7b93a04e3dff8054a97b3f41254719d352d;hpb=6833ce8bdca2d64e14485118f2a4417b7e1cb1b1 diff --git a/strdup.c b/strdup.c index 0249a05..9920a4a 100644 --- a/strdup.c +++ b/strdup.c @@ -1,19 +1,27 @@ +/* + * 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 *strdup (const char *s) +{ /* __MEM_CHECKED__ */ char *d; - + if (s == NULL) return NULL; - - if ((d = malloc (strlen (s) + 1)) == NULL) /* __MEM_CHECKED__ */ + + if ((d = malloc (str_len (s) + 1)) == NULL) /* __MEM_CHECKED__ */ return NULL; - memcpy (d, s, strlen (s) + 1); + memcpy (d, s, str_len (s) + 1); return d; } -