home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
ARCHIVERS
/
lha205.lzh
/
strdup.c
< prev
next >
Wrap
Text File
|
1992-05-11
|
374b
|
29 lines
/*
* strdup.c
*/
#ifdef NOSTRDUP
#ifdef sony_news
#include <sys/param.h>
#define _SIZE_T
#endif
#if defined(__STDC__) || defined(NEWSOS)
#include <stdlib.h>
#endif
#ifndef NULL
#define NULL (char *)0
#endif
char *strdup ( buf )
char *buf;
{
char *p;
if ((p = (char *)malloc(strlen(buf) + 1)) == NULL) return NULL;
strcpy( p, buf );
return p;
}
#endif