summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/ungetwc.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2003-11-04 11:05:55 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2003-11-04 11:05:55 +0000
commita27a4b369016302f5feeeceed5a128aedb6bcb1f (patch)
treede1efe529ace379f46b768f97f638aa004be19ea /lib/libc/stdio/ungetwc.c
parent92797e8470d5966562f258b4c73f28a784000e21 (diff)
Notes
Diffstat (limited to 'lib/libc/stdio/ungetwc.c')
-rw-r--r--lib/libc/stdio/ungetwc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libc/stdio/ungetwc.c b/lib/libc/stdio/ungetwc.c
index e20a763c47ee..c9d5c490b3c2 100644
--- a/lib/libc/stdio/ungetwc.c
+++ b/lib/libc/stdio/ungetwc.c
@@ -43,13 +43,11 @@ wint_t
__ungetwc(wint_t wc, FILE *fp)
{
char buf[MB_LEN_MAX];
- mbstate_t mbs;
size_t len;
if (wc == WEOF)
return (WEOF);
- memset(&mbs, 0, sizeof(mbs));
- if ((len = wcrtomb(buf, wc, &mbs)) == (size_t)-1) {
+ if ((len = wcrtomb(buf, wc, NULL)) == (size_t)-1) {
fp->_flags |= __SERR;
return (WEOF);
}