]> oss.titaniummirror.com Git - msp430-gcc.git/blobdiff - libiberty/xmemdup.c
Imported gcc-4.4.3
[msp430-gcc.git] / libiberty / xmemdup.c
index 9e9d66b715dbccafcef28f11a368af2ef64a3f1c..d4831163a204fe8e3a9ec5454577f269bd0fc514 100644 (file)
@@ -24,15 +24,15 @@ 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
-xmemdup (input, copy_size, alloc_size)
-  const PTR input;
-  size_t copy_size;
-  size_t alloc_size;
+xmemdup (const PTR input, size_t copy_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);
 }