mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-24 11:24:05 +08:00
6599da043e
From-SVN: r14877
11 lines
172 B
C
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;
|
|
}
|