diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2016-08-25 17:30:00 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2016-08-25 17:30:00 +0000 |
commit | d64004f09ec25969039262cfe608f01d34f6cd59 (patch) | |
tree | c587c8c236aaa21218d248a47d86b694799a6e7f /lib/libc/stdio/fputwc.c | |
parent | 1bf6c5f18b105f62a472f7b7a524ca66ed1fe573 (diff) | |
download | src-d64004f09ec25969039262cfe608f01d34f6cd59.tar.gz src-d64004f09ec25969039262cfe608f01d34f6cd59.zip |
Remove "Fast path", it bypass __wcrtomb() and all its error checking.
One of affected encoding example: US-ASCII
MFC after: 7 days
Notes
Notes:
svn path=/head/; revision=304811
Diffstat (limited to 'lib/libc/stdio/fputwc.c')
-rw-r--r-- | lib/libc/stdio/fputwc.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/libc/stdio/fputwc.c b/lib/libc/stdio/fputwc.c index 7b05d4a876db..7f0c9109b087 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++) |