diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1997-08-21 22:57:35 +0000 |
---|---|---|
committer | Jason Merrill <jason@yorick.cygnus.com> | 1997-08-21 22:57:35 +0000 |
commit | 544daae9b2d0c2083668aedc97de9b1cd78d859b (patch) | |
tree | a3b19970338bdae580faff126a716e1d5520400c /libiberty/strdup.c | |
parent | 6a624df1d7255538e2f7140ffda888b1dd5ab8d2 (diff) |
Initial revision
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@14877 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/strdup.c')
-rw-r--r-- | libiberty/strdup.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libiberty/strdup.c b/libiberty/strdup.c new file mode 100644 index 00000000000..1785b34f274 --- /dev/null +++ b/libiberty/strdup.c @@ -0,0 +1,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; +} |