projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(my_strtoumax): Fix typo in computing
[gnulib.git]
/
lib
/
strndup.c
diff --git
a/lib/strndup.c
b/lib/strndup.c
index
f4b1f7a
..
40e0ac2
100644
(file)
--- a/
lib/strndup.c
+++ b/
lib/strndup.c
@@
-33,9
+33,7
@@
char *malloc ();
/* Duplicate S, returning an identical malloc'd string. */
char *
/* 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);
{
char *new = malloc (n + 1);
@@
-43,5
+41,5
@@
strndup (s, n)
return NULL;
new[n] = '\0';
return NULL;
new[n] = '\0';
- return memcpy (new, s, n);
+ return
(char *)
memcpy (new, s, n);
}
}