home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 14
/
CD_ASCQ_14_0694.iso
/
maj
/
653
/
strdup.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-04-03
|
273b
|
16 lines
/*
** Portable, public domain strdup() by Bob Stout
*/
#include <stdlib.h>
#include <string.h>
char *strdup(const char *string)
{
char *new;
if (NULL != (new = malloc(strlen(string) + 1)))
strcpy(new, string);
return new;
}