diff options
author | huderlem <huderlem@gmail.com> | 2020-02-15 09:06:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-15 09:06:38 -0600 |
commit | 74e171579e0bbefbd72b83f3764fe504464bbdbe (patch) | |
tree | 8db5aacbe963fef56eb2d9965fc87db1a6642387 /libiberty/xstrdup.c | |
parent | 27176890c4a688ea7de44d3f55af32827016a9fd (diff) | |
parent | c6bcd24dfe44d58ed1b6bef6653270dbf6cd6bfa (diff) |
Merge pull request #30 from camthesaxman/arm_support
Build ARM compiler
Diffstat (limited to 'libiberty/xstrdup.c')
-rwxr-xr-x | libiberty/xstrdup.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libiberty/xstrdup.c b/libiberty/xstrdup.c new file mode 100755 index 0000000..9d08bc7 --- /dev/null +++ b/libiberty/xstrdup.c @@ -0,0 +1,17 @@ +/* xstrdup.c -- Duplicate a string in memory, using xmalloc. + This trivial function is in the public domain. + Ian Lance Taylor, Cygnus Support, December 1995. */ + +#include "ansidecl.h" +#include "libiberty.h" + +char * +xstrdup (s) + const char *s; +{ + char *ret; + + ret = xmalloc (strlen (s) + 1); + strcpy (ret, s); + return ret; +} |