summaryrefslogtreecommitdiff
path: root/src/stdio/ungetwc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/ungetwc.c')
-rw-r--r--src/stdio/ungetwc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/ungetwc.c b/src/stdio/ungetwc.c
index 394f92ac..d4c7de39 100644
--- a/src/stdio/ungetwc.c
+++ b/src/stdio/ungetwc.c
@@ -11,7 +11,7 @@ wint_t ungetwc(wint_t c, FILE *f)
FLOCK(f);
- f->mode |= f->mode+1;
+ if (f->mode <= 0) fwide(f, 1);
if (!f->rpos) __toread(f);
if (!f->rpos || f->rpos < f->buf - UNGET + l || c == WEOF ||