summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/strerror_r.c
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2013-06-01 21:26:17 +0000
committerstsp <stsp@openbsd.org>2013-06-01 21:26:17 +0000
commite62104c65c5b61876c76401381645f8ee79a9084 (patch)
tree9740082b2d873563770e3f7895b5e6003a8ce3c6 /lib/libc/string/strerror_r.c
parent- remove more backward compat code and switch the callers over to the new function (diff)
downloadwireguard-openbsd-e62104c65c5b61876c76401381645f8ee79a9084.tar.xz
wireguard-openbsd-e62104c65c5b61876c76401381645f8ee79a9084.zip
Fix catopen(3) for UTF-8 locales and update the implementation to POSIX-2008.
Catalogs had an arbitrary character set which was used regardless of locale. Add UTF-8-encoded catalogs for libc error messages, and rename existing ones to indicate their character sets. catopen(3) now chooses a catalog which matches the locale's encoding, if available. help & ok matthew, man page bits ok jmc, input from naddy and bluhm
Diffstat (limited to 'lib/libc/string/strerror_r.c')
-rw-r--r--lib/libc/string/strerror_r.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/string/strerror_r.c b/lib/libc/string/strerror_r.c
index aa63408ab86..b85136055b1 100644
--- a/lib/libc/string/strerror_r.c
+++ b/lib/libc/string/strerror_r.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strerror_r.c,v 1.7 2007/03/01 16:29:09 bluhm Exp $ */
+/* $OpenBSD: strerror_r.c,v 1.8 2013/06/01 21:26:18 stsp Exp $ */
/* Public Domain <marc@snafu.org> */
#ifdef NLS
@@ -75,7 +75,7 @@ __num2string(int num, int sign, int setid, char *buf, size_t buflen,
#ifdef NLS
nl_catd catd;
- catd = catopen("libc", 0);
+ catd = catopen("libc", NL_CAT_LOCALE);
#endif
if (0 <= num && num < max) {