2016-04-30 15:50:04 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
char* strdup(const char* str)
|
2006-09-07 16:14:53 +02:00
|
|
|
{
|
|
|
|
char* res;
|
|
|
|
int len;
|
|
|
|
len=strlen(str)+1;
|
|
|
|
res=malloc(len);
|
2016-05-19 14:15:22 +02:00
|
|
|
if(res)
|
|
|
|
memcpy(res,str,len);
|
2006-09-07 16:14:53 +02:00
|
|
|
return res;
|
|
|
|
}
|