diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2005-03-25 04:05:12 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2005-03-25 04:05:12 +0000 |
commit | bb99744fd4346bc283e19ecc2236f320a6901242 (patch) | |
tree | 5755195d1ce674183bfde67ec9b821bff117374f /libiberty/xstrdup.c | |
parent | cba9e10abbeccd3d3b9839ab6df5e187077c5bcb (diff) | |
download | gcc-bb99744fd4346bc283e19ecc2236f320a6901242.zip gcc-bb99744fd4346bc283e19ecc2236f320a6901242.tar.gz gcc-bb99744fd4346bc283e19ecc2236f320a6901242.tar.bz2 |
* xmemdup.c, xstrdup.c: Expose the tail call.
From-SVN: r97033
Diffstat (limited to 'libiberty/xstrdup.c')
-rw-r--r-- | libiberty/xstrdup.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libiberty/xstrdup.c b/libiberty/xstrdup.c index 5aa084a..5ddd2e9 100644 --- a/libiberty/xstrdup.c +++ b/libiberty/xstrdup.c @@ -19,6 +19,10 @@ obtain memory. #endif #ifdef HAVE_STRING_H #include <string.h> +#else +# ifdef HAVE_STRINGS_H +# include <strings.h> +# endif #endif #include "ansidecl.h" #include "libiberty.h" @@ -29,6 +33,5 @@ xstrdup (s) { register size_t len = strlen (s) + 1; register char *ret = xmalloc (len); - memcpy (ret, s, len); - return ret; + return (char *) memcpy (ret, s, len); } |