From: Rich Felker Date: Sat, 6 Jun 2015 18:20:30 +0000 (+0000) Subject: remove another invalid skip of locking in ungetwc X-Git-Tag: v1.1.11~56 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=312eea2ea4f4363fb01b73660c08bfcf43dd3bb4;p=oweals%2Fmusl.git remove another invalid skip of locking in ungetwc --- diff --git a/src/stdio/ungetwc.c b/src/stdio/ungetwc.c index 0a4cd7a1..394f92ac 100644 --- a/src/stdio/ungetwc.c +++ b/src/stdio/ungetwc.c @@ -9,14 +9,12 @@ wint_t ungetwc(wint_t c, FILE *f) unsigned char mbc[MB_LEN_MAX]; int l=1; - if (c == WEOF) return c; - FLOCK(f); f->mode |= f->mode+1; 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)) { FUNLOCK(f); return WEOF;