aboutsummaryrefslogtreecommitdiff
path: root/libiberty/xstrdup.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-03-25 04:27:21 +0000
committerDJ Delorie <dj@redhat.com>2005-03-25 04:27:21 +0000
commit51e32d644ad69408eacefacd21e015a6c9c519c2 (patch)
tree0be909d739e50b4e267565b0480ab13af23d2ea6 /libiberty/xstrdup.c
parent695a4822ce79fd4f6d0964091c61e070ff77a189 (diff)
downloadgdb-51e32d644ad69408eacefacd21e015a6c9c519c2.zip
gdb-51e32d644ad69408eacefacd21e015a6c9c519c2.tar.gz
gdb-51e32d644ad69408eacefacd21e015a6c9c519c2.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/xstrdup.c')
-rw-r--r--libiberty/xstrdup.c7
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);
}