X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fstrdup.c;h=251145a29e34043e53d125c26b1be5a18dd7d52a;hb=128545e06224233b7e91fc4c83f8830252fe16c9;hp=18df0105fb45ac513b2021d8d91e3928d606111c;hpb=898bc853c79a8a8506f39c6f57a7febe98b6afe4;p=mmh diff --git a/sbr/strdup.c b/sbr/strdup.c index 18df010..251145a 100644 --- a/sbr/strdup.c +++ b/sbr/strdup.c @@ -2,10 +2,13 @@ /* * strdup.c -- duplicate a string * - * $Id$ + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include +#include char * @@ -18,8 +21,7 @@ strdup (const char *str) return NULL; len = strlen(str) + 1; - if (!(cp = malloc (len))) - return NULL; + cp = mh_xmalloc (len); memcpy (cp, str, len); return cp; }