home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
POINT Software Programming
/
PPROG1.ISO
/
c
/
snippets
/
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
|
1994-04-03
|
273 b
|
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;
}