diff options
Diffstat (limited to 'lib/libc/stdio/fputwc.c')
-rw-r--r-- | lib/libc/stdio/fputwc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdio/fputwc.c b/lib/libc/stdio/fputwc.c index 10c3c18..1f42ce9 100644 --- a/lib/libc/stdio/fputwc.c +++ b/lib/libc/stdio/fputwc.c @@ -57,8 +57,10 @@ __fputwc(wchar_t wc, FILE *fp) len = 1; } else { memset(&mbs, 0, sizeof(mbs)); - if ((len = wcrtomb(buf, wc, &mbs)) == (size_t)-1) + if ((len = wcrtomb(buf, wc, &mbs)) == (size_t)-1) { + fp->_flags |= __SERR; return (WEOF); + } } for (i = 0; i < len; i++) |