summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/fputwc.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-05-22 15:19:41 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-05-22 15:19:41 +0000
commit87275e436a0fb31fea2757532860a3ec993d2cd6 (patch)
treef6b3a5846b5b7d1a722dc68d0c48e70c32df2e55 /lib/libc/stdio/fputwc.c
parentd0834d4dc80a4f57c5979ccd810fc2e2c204d595 (diff)
Notes
Diffstat (limited to 'lib/libc/stdio/fputwc.c')
-rw-r--r--lib/libc/stdio/fputwc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/stdio/fputwc.c b/lib/libc/stdio/fputwc.c
index f1e6bf10cb46..3f3984db1f10 100644
--- a/lib/libc/stdio/fputwc.c
+++ b/lib/libc/stdio/fputwc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2002 Tim J. Robbins.
+ * Copyright (c) 2002-2004 Tim J. Robbins.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$");
wint_t
__fputwc(wchar_t wc, FILE *fp)
{
- static const mbstate_t initial;
- mbstate_t mbs;
char buf[MB_LEN_MAX];
size_t i, len;
@@ -57,8 +55,8 @@ __fputwc(wchar_t wc, FILE *fp)
*buf = (unsigned char)wc;
len = 1;
} else {
- mbs = initial;
- if ((len = wcrtomb(buf, wc, &mbs)) == (size_t)-1) {
+ if ((len = wcrtomb(buf, wc, &fp->_extra->mbstate)) ==
+ (size_t)-1) {
fp->_flags |= __SERR;
return (WEOF);
}