freebsd-nq/gnu/libexec/uucp/libuucp/strdup.c

19 lines
259 B
C
Raw Normal View History

1993-08-05 18:28:27 +00:00
/* strdup.c
Duplicate a string into memory. */
#include "uucp.h"
char *
strdup (z)
const char *z;
{
size_t csize;
char *zret;
csize = strlen (z) + 1;
zret = malloc (csize);
if (zret != NULL)
memcpy (zret, z, csize);
return zret;
}