home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 15
/
AACD15.ISO
/
AACD
/
Programming
/
Python2
/
Python20_source
/
Python
/
strdup.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
2000-10-25
|
256 b
|
15 lines
/* strdup() replacement (from stdwin, if you must know) */
#include "pgenheaders.h"
char *
strdup(const char *str)
{
if (str != NULL) {
register char *copy = malloc(strlen(str) + 1);
if (copy != NULL)
return strcpy(copy, str);
}
return NULL;
}