X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fstrdup.c;h=ebc29f59a4eaaba07636ab4aed3ab8e94707e7a0;hp=18df0105fb45ac513b2021d8d91e3928d606111c;hb=fb49dd82ec42997b9df97f221c920f6596102c0a;hpb=898bc853c79a8a8506f39c6f57a7febe98b6afe4 diff --git a/sbr/strdup.c b/sbr/strdup.c index 18df010..ebc29f5 100644 --- a/sbr/strdup.c +++ b/sbr/strdup.c @@ -3,9 +3,14 @@ * 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 +23,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; }