summaryrefslogtreecommitdiff
path: root/libc/string/strlcpy.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
commitaf0172162f7c653cad6a11ed1c1a5459bc154465 (patch)
tree70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/string/strlcpy.c
parentc8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff)
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/string/strlcpy.c')
-rw-r--r--libc/string/strlcpy.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/libc/string/strlcpy.c b/libc/string/strlcpy.c
index 3920db083..2f3d29fff 100644
--- a/libc/string/strlcpy.c
+++ b/libc/string/strlcpy.c
@@ -8,18 +8,22 @@
#include "_string.h"
#ifdef WANT_WIDE
-# define __Wstrlcpy __wcslcpy
-# define Wstrlcpy wcslcpy
+# define Wstrlcpy __wcslcpy
+# define Wstrxfrm wcsxfrm
#else
-# define __Wstrlcpy __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
+attribute_hidden
+#endif
+size_t Wstrlcpy(register Wchar *__restrict dst,
register const Wchar *__restrict src,
size_t n)
{
@@ -42,15 +46,16 @@ size_t attribute_hidden __Wstrlcpy(register Wchar *__restrict dst,
return src - src0;
}
-
-strong_alias(__Wstrlcpy,Wstrlcpy)
-
+#ifndef WANT_WIDE
+libc_hidden_proto(strlcpy)
+libc_hidden_def(strlcpy)
+#ifndef __UCLIBC_HAS_LOCALE__
+strong_alias(strlcpy,strxfrm)
+libc_hidden_proto(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