aboutsummaryrefslogtreecommitdiff
path: root/libiberty/xmemdup.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2005-03-25 04:05:12 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2005-03-25 04:05:12 +0000
commitbb99744fd4346bc283e19ecc2236f320a6901242 (patch)
tree5755195d1ce674183bfde67ec9b821bff117374f /libiberty/xmemdup.c
parentcba9e10abbeccd3d3b9839ab6df5e187077c5bcb (diff)
downloadgcc-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/xmemdup.c')
-rw-r--r--libiberty/xmemdup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libiberty/xmemdup.c b/libiberty/xmemdup.c
index 9e9d66b..0dae37d 100644
--- a/libiberty/xmemdup.c
+++ b/libiberty/xmemdup.c
@@ -24,6 +24,10 @@ allocated, the remaining memory is zeroed.
#include <sys/types.h> /* For size_t. */
#ifdef HAVE_STRING_H
#include <string.h>
+#else
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
#endif
PTR
@@ -33,6 +37,5 @@ xmemdup (input, copy_size, alloc_size)
size_t alloc_size;
{
PTR output = xcalloc (1, alloc_size);
- memcpy (output, input, copy_size);
- return output;
+ return (PTR) memcpy (output, input, copy_size);
}