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