提交 312eea2e 编写于 作者: R Rich Felker

remove another invalid skip of locking in ungetwc

上级 3d7e32d2
...@@ -9,14 +9,12 @@ wint_t ungetwc(wint_t c, FILE *f) ...@@ -9,14 +9,12 @@ wint_t ungetwc(wint_t c, FILE *f)
unsigned char mbc[MB_LEN_MAX]; unsigned char mbc[MB_LEN_MAX];
int l=1; int l=1;
if (c == WEOF) return c;
FLOCK(f); FLOCK(f);
f->mode |= f->mode+1; f->mode |= f->mode+1;
if (!f->rpos) __toread(f); if (!f->rpos) __toread(f);
if (!f->rpos || f->rpos < f->buf - UNGET + l || if (!f->rpos || f->rpos < f->buf - UNGET + l || c == WEOF ||
(!isascii(c) && (l = wctomb((void *)mbc, c)) < 0)) { (!isascii(c) && (l = wctomb((void *)mbc, c)) < 0)) {
FUNLOCK(f); FUNLOCK(f);
return WEOF; return WEOF;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册