summaryrefslogtreecommitdiff
path: root/libc/string/strndup.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/string/strndup.c')
-rw-r--r--libc/string/strndup.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libc/string/strndup.c b/libc/string/strndup.c
index 5cee0272d..89c58ccec 100644
--- a/libc/string/strndup.c
+++ b/libc/string/strndup.c
@@ -8,18 +8,21 @@
#include "_string.h"
#include <stdlib.h>
-char attribute_hidden *__strndup(register const char *s1, size_t n)
+libc_hidden_proto(strndup)
+libc_hidden_proto(strnlen)
+libc_hidden_proto(memcpy)
+
+char *strndup(register const char *s1, size_t n)
{
register char *s;
- n = __strnlen(s1,n); /* Avoid problems if s1 not nul-terminated. */
+ n = strnlen(s1,n); /* Avoid problems if s1 not nul-terminated. */
if ((s = malloc(n + 1)) != NULL) {
- __memcpy(s, s1, n);
+ memcpy(s, s1, n);
s[n] = 0;
}
return s;
}
-
-strong_alias(__strndup,strndup)
+libc_hidden_def(strndup)