3 * strdup.c -- duplicate a string
5 * This code is Copyright (c) 2002, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
15 strdup (const char *str)
23 len = strlen(str) + 1;
24 cp = mh_xmalloc (len);
25 memcpy (cp, str, len);