summaryrefslogtreecommitdiff
path: root/libc/string
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-03-09 21:30:53 +0100
committerPeter S. Mazinger <ps.m@gmx.net>2011-03-09 21:30:53 +0100
commit1350fdff4b950d42771d6ea7b246e2d269e2bd72 (patch)
tree35a3a5645f4164eefb67a8083e994f51331a200a /libc/string
parentf4ec824864b8ea68af8953669f789656cc05143d (diff)
wchar.h, _collate.c, strlcpy.c: use a common prototype of __wcslcpy
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Diffstat (limited to 'libc/string')
-rw-r--r--libc/string/_collate.c3
-rw-r--r--libc/string/strlcpy.c20
2 files changed, 5 insertions, 18 deletions
diff --git a/libc/string/_collate.c b/libc/string/_collate.c
index 58faa5a84..be1951301 100644
--- a/libc/string/_collate.c
+++ b/libc/string/_collate.c
@@ -537,9 +537,6 @@ libc_hidden_def(__XL_NPP(wcscoll))
#ifdef WANT_WIDE
-extern size_t __wcslcpy(wchar_t *__restrict dst,
- const wchar_t *__restrict src, size_t n);
-
size_t __XL_NPP(wcsxfrm)(wchar_t *__restrict ws1, const wchar_t *__restrict ws2,
size_t n __LOCALE_PARAM )
{
diff --git a/libc/string/strlcpy.c b/libc/string/strlcpy.c
index 049c92e0a..83787049a 100644
--- a/libc/string/strlcpy.c
+++ b/libc/string/strlcpy.c
@@ -9,19 +9,16 @@
#ifdef WANT_WIDE
# define Wstrlcpy __wcslcpy
+# define Wstrxfrm wcsxfrm
#else
# 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. */
-#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)
@@ -45,17 +42,10 @@ size_t Wstrlcpy(register Wchar *__restrict dst,
return src - src0;
}
-#ifdef WANT_WIDE
-
-#ifndef __UCLIBC_HAS_LOCALE__
-strong_alias(__wcslcpy,wcsxfrm)
-#endif
-
-#else
-
+#ifndef WANT_WIDE
libc_hidden_def(strlcpy)
-#ifndef __UCLIBC_HAS_LOCALE__
-strong_alias(strlcpy,strxfrm)
#endif
+#ifndef __UCLIBC_HAS_LOCALE__
+strong_alias(Wstrlcpy,Wstrxfrm)
#endif