X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fstrdup.c;h=251145a29e34043e53d125c26b1be5a18dd7d52a;hb=edcaa954bab2d48b54ab3dbcbe3788dc104044dc;hp=486b36a86dcee164fc1c8ac810aac88cff446c42;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/sbr/strdup.c b/sbr/strdup.c index 486b36a..251145a 100644 --- a/sbr/strdup.c +++ b/sbr/strdup.c @@ -2,14 +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 * @@ -22,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; }