summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fputwc.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-08-30 09:16:57 -0300
committerRenato Botelho <renato@netgate.com>2016-08-30 09:16:57 -0300
commit39fd693a18f8ef73b1268f2321393d5ca6101e89 (patch)
treeb1bae394d01f4c868d315c2d7a2f7f7f0539a57b /lib/libc/stdio/fputwc.c
parent29ebd1247162a77db08e5e2e00d033220ec807fe (diff)
parentde43eec3e10416a7e9f3a7565f70e1ba2d265384 (diff)
downloadFreeBSD-src-39fd693a18f8ef73b1268f2321393d5ca6101e89.zip
FreeBSD-src-39fd693a18f8ef73b1268f2321393d5ca6101e89.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'lib/libc/stdio/fputwc.c')
-rw-r--r--lib/libc/stdio/fputwc.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/libc/stdio/fputwc.c b/lib/libc/stdio/fputwc.c
index 7b05d4a..7f0c910 100644
--- a/lib/libc/stdio/fputwc.c
+++ b/lib/libc/stdio/fputwc.c
@@ -53,19 +53,9 @@ __fputwc(wchar_t wc, FILE *fp, locale_t locale)
size_t i, len;
struct xlocale_ctype *l = XLOCALE_CTYPE(locale);
- if (MB_CUR_MAX == 1 && wc > 0 && wc <= UCHAR_MAX) {
- /*
- * Assume single-byte locale with no special encoding.
- * A more careful test would be to check
- * _CurrentRuneLocale->encoding.
- */
- *buf = (unsigned char)wc;
- len = 1;
- } else {
- if ((len = l->__wcrtomb(buf, wc, &fp->_mbstate)) == (size_t)-1) {
- fp->_flags |= __SERR;
- return (WEOF);
- }
+ if ((len = l->__wcrtomb(buf, wc, &fp->_mbstate)) == (size_t)-1) {
+ fp->_flags |= __SERR;
+ return (WEOF);
}
for (i = 0; i < len; i++)
OpenPOWER on IntegriCloud