summaryrefslogtreecommitdiffstats
path: root/libc/string/strlcpy.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/strlcpy.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/strlcpy.c')
-rw-r--r--libc/string/strlcpy.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/libc/string/strlcpy.c b/libc/string/strlcpy.c
index 3920db083..e888b85b2 100644
--- a/libc/string/strlcpy.c
+++ b/libc/string/strlcpy.c
@@ -8,18 +8,25 @@
#include "_string.h"
#ifdef WANT_WIDE
-# define __Wstrlcpy __wcslcpy
-# define Wstrlcpy wcslcpy
+# define Wstrlcpy __wcslcpy
+# define Wstrxfrm wcsxfrm
#else
-# define __Wstrlcpy __strlcpy
+libc_hidden_proto(strlcpy)
# define Wstrlcpy strlcpy
+# define Wstrxfrm strxfrm
#endif
+
/* OpenBSD function:
* Copy at most n-1 chars from src to dst and nul-terminate dst.
* Returns strlen(src), so truncation occurred if the return value is >= n. */
-size_t attribute_hidden __Wstrlcpy(register Wchar *__restrict dst,
+#ifdef WANT_WIDE
+size_t Wstrlcpy(register Wchar *__restrict dst,
+ register const Wchar *__restrict src,
+ size_t n) attribute_hidden;
+#endif
+size_t Wstrlcpy(register Wchar *__restrict dst,
register const Wchar *__restrict src,
size_t n)
{
@@ -42,15 +49,15 @@ size_t attribute_hidden __Wstrlcpy(register Wchar *__restrict dst,
return src - src0;
}
-
-strong_alias(__Wstrlcpy,Wstrlcpy)
-
+#ifndef WANT_WIDE
+libc_hidden_def(strlcpy)
+#ifndef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(strxfrm)
+strong_alias(strlcpy,strxfrm)
+libc_hidden_def(strxfrm)
+#endif
+#else
#ifndef __UCLIBC_HAS_LOCALE__
-# ifdef WANT_WIDE
-hidden_strong_alias(__wcslcpy,__wcsxfrm)
strong_alias(__wcslcpy,wcsxfrm)
-# else
-hidden_strong_alias(__strlcpy,__strxfrm)
-strong_alias(__strlcpy,strxfrm)
-# endif
+#endif
#endif