aboutsummaryrefslogtreecommitdiff
path: root/libiberty/xstrndup.c
diff options
context:
space:
mode:
Diffstat (limited to 'libiberty/xstrndup.c')
-rw-r--r--libiberty/xstrndup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libiberty/xstrndup.c b/libiberty/xstrndup.c
index 68c5f45..0a41f60 100644
--- a/libiberty/xstrndup.c
+++ b/libiberty/xstrndup.c
@@ -53,8 +53,8 @@ xstrndup (const char *s, size_t n)
if (n < len)
len = n;
- result = xmalloc (len + 1);
+ result = XNEWVEC (char, len + 1);
result[len] = '\0';
- return memcpy (result, s, len);
+ return (char *) memcpy (result, s, len);
}