(my_strtoumax): Fix typo in computing
[gnulib.git] / lib / strndup.c
index f4b1f7a..40e0ac2 100644 (file)
@@ -33,9 +33,7 @@ char *malloc ();
 
 /* Duplicate S, returning an identical malloc'd string.  */
 char *
-strndup (s, n)
-     const char *s;
-     size_t n;
+strndup (const char *s, size_t n)
 {
   char *new = malloc (n + 1);
 
@@ -43,5 +41,5 @@ strndup (s, n)
     return NULL;
 
   new[n] = '\0';
-  return memcpy (new, s, n);
+  return (char *) memcpy (new, s, n);
 }