home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
py2s152.zip
/
Python
/
strdup.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-27
|
277b
|
16 lines
/* strdup() replacement (from stdwin, if you must know) */
#include "pgenheaders.h"
char *
strdup(str)
const char *str;
{
if (str != NULL) {
register char *copy = malloc(strlen(str) + 1);
if (copy != NULL)
return strcpy(copy, str);
}
return NULL;
}