2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2024-12-30 10:14:53 +08:00
gcc/libiberty/strdup.c
Jason Merrill 6599da043e Initial revision
From-SVN: r14877
1997-08-21 18:57:35 -04:00

11 lines
172 B
C

char *
strdup(s)
char *s;
{
char *result = (char*)malloc(strlen(s) + 1);
if (result == (char*)0)
return (char*)0;
strcpy(result, s);
return result;
}