home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 2
/
crawlyvol2.bin
/
program
/
c
/
plstsrc
/
tcstuff
/
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
|
1988-12-18
|
258 b
|
16 lines
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char *strdup(char *s)
{
int len;
char *adr;
if (s == 0)
return(0);
len = strlen(s);
if ((adr = malloc(len+1)) == 0)
return(0);
strcpy(adr,s);
return(adr);
}