summaryrefslogtreecommitdiffstats
path: root/libc/string/strndup.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 04:03:33 +0000
commitcb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8 (patch)
tree520f8e8d113184cfa7954ebd274564b8c255fa9a /libc/string/strndup.c
parente4461be66e2655058aef358b00050bc70ac72861 (diff)
downloaduClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.bz2
uClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.xz
Merge from trunk. Going pretty good so far. Kind of. Okay, not really.
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)