aboutsummaryrefslogtreecommitdiff
path: root/libiberty/strdup.c
blob: 1785b34f2745a1e43d61cf42bbec1862506dd2fb (plain)
1
2
3
4
5
6
7
8
9
10
char *
strdup(s)
     char *s;
{
    char *result = (char*)malloc(strlen(s) + 1);
    if (result == (char*)0)
	return (char*)0;
    strcpy(result, s);
    return result;
}