]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - libiberty/strndup.c
merge from gcc
[thirdparty/binutils-gdb.git] / libiberty / strndup.c
index 9395fc8fe6507417fa6dcc5cbbbe4bac6df8371b..9e9b4e2991f833082acd176f48825f76d5a888b9 100644 (file)
@@ -46,10 +46,10 @@ strndup (const char *s, size_t n)
   if (n < len)
     len = n;
 
-  result = malloc (len + 1);
+  result = (char *) malloc (len + 1);
   if (!result)
     return 0;
 
   result[len] = '\0';
-  return memcpy (result, s, len);
+  return (char *) memcpy (result, s, len);
 }