]> git.ipfire.org Git - thirdparty/gcc.git/blame - libiberty/strdup.c
configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to config.status.
[thirdparty/gcc.git] / libiberty / strdup.c
CommitLineData
aaa5f039
DD
1/*
2
3@deftypefn Supplemental char* strdup (const char *@var{s})
4
5Returns a pointer to a copy of @var{s} in memory obtained from
7f8fa05d 6@code{malloc}, or @code{NULL} if insufficient memory was available.
aaa5f039
DD
7
8@end deftypefn
9
10*/
11
6599da04
JM
12char *
13strdup(s)
14 char *s;
15{
16 char *result = (char*)malloc(strlen(s) + 1);
17 if (result == (char*)0)
18 return (char*)0;
19 strcpy(result, s);
20 return result;
21}