diff options
author | DJ Delorie <dj@delorie.com> | 2005-03-25 04:57:08 +0000 |
---|---|---|
committer | DJ Delorie <dj@delorie.com> | 2005-03-25 04:57:08 +0000 |
commit | b2115a6c37e4fdac54d62d7695647d7a205f1823 (patch) | |
tree | 377e49d4d493102be42f3a8b26c23dcb08cf01ea /libiberty/xmemdup.c | |
parent | c15495d46a949d6ff9a783d941affba176639d1e (diff) | |
download | binutils-redhat-b2115a6c37e4fdac54d62d7695647d7a205f1823.tar.gz |
merge from gcc
Diffstat (limited to 'libiberty/xmemdup.c')
-rw-r--r-- | libiberty/xmemdup.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libiberty/xmemdup.c b/libiberty/xmemdup.c index 9e9d66b715..0dae37d892 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); } |