kolibrios/programs/develop/metcc/trunk/libc/string/strdup.c

10 lines
132 B
C
Raw Normal View History

char* strdup(char* str)
{
char* res;
int len;
len=strlen(str)+1;
res=malloc(len);
memcpy(res,str,len);
return res;
}