home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
p
/
python
/
pytexdoc
/
ext
/
source
/
!Python
/
Monty
/
c
/
strdup
< 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
Text File
|
1996-11-06
|
321 b
|
20 lines
/* strdup() replacement (from stdwin, if you must know) */
#include "config.h"
#include "myproto.h"
#include "mymalloc.h"
#include <string.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;
}