From 174ab56c0677389bd4e851654d45bdb5473912eb Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 10 Jan 2018 21:55:53 +0000 Subject: [PATCH] fgetwc may clobber errno when the result is not WEOF --- src/regression/fgetwc-buffering.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/regression/fgetwc-buffering.c b/src/regression/fgetwc-buffering.c index a73ad54..dc0a13d 100644 --- a/src/regression/fgetwc-buffering.c +++ b/src/regression/fgetwc-buffering.c @@ -23,11 +23,11 @@ int main() A(write(p[1], "\200", 1) == 1); close(p[1]); - errno = 0; wc = fgetwc(stdin); if (wc != 0x800) t_error("wanted 0x800, got 0x%x\n", (unsigned)wc); + errno = 0; wc = fgetwc(stdin); if (wc != WEOF) t_error("wanted WEOF, got 0x%x\n", (unsigned)wc); -- 2.11.4.GIT