]>
diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/sbr/getcpy.c
1 /* getcpy.c - copy a string in managed memory */
13 if ((cp
= malloc ((unsigned) (1))) == NULL
)
14 adios (NULLCP
, "unable to allocate string storage");
15 (void) strcpy (cp
, "");
17 if ((cp
= malloc ((unsigned) (strlen (str
) + 1))) == NULL
)
18 adios (NULLCP
, "unable to allocate string storage");
20 (void) strcpy (cp
, str
);