]> diplodocus.org Git - nmh/blob - sbr/getcpy.c
Alter mh-chart(7)'s NAME to be lowercase.
[nmh] / sbr / getcpy.c
1
2 /*
3 * getcpy.c -- copy a string in managed memory
4 *
5 * THIS IS OBSOLETE. NEED TO REPLACE ALL OCCURRENCES
6 * OF GETCPY WITH STRDUP. BUT THIS WILL REQUIRE
7 * CHANGING PARTS OF THE CODE TO DEAL WITH NULL VALUES.
8 *
9 * This code is Copyright (c) 2002, by the authors of nmh. See the
10 * COPYRIGHT file in the root directory of the nmh distribution for
11 * complete copyright information.
12 */
13
14 #include <h/mh.h>
15 #include <h/utils.h>
16
17 /* Return malloc'd copy of str, or of "" if NULL, exit on failure. */
18 char *getcpy(const char *str)
19 {
20 if (str)
21 return mh_xstrdup(str);
22
23 return mh_xcalloc(1, 1);
24 }