projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4db9f0f
)
fgetwc may clobber errno when the result is not WEOF
author
Szabolcs Nagy
<nsz@port70.net>
Wed, 10 Jan 2018 21:55:53 +0000
(21:55 +0000)
committer
Szabolcs Nagy
<nsz@port70.net>
Wed, 10 Jan 2018 21:55:53 +0000
(21:55 +0000)
src/regression/fgetwc-buffering.c
patch
|
blob
|
history
diff --git
a/src/regression/fgetwc-buffering.c
b/src/regression/fgetwc-buffering.c
index
a73ad54
..
dc0a13d
100644
(file)
--- 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]);
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);
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);
wc = fgetwc(stdin);
if (wc != WEOF)
t_error("wanted WEOF, got 0x%x\n", (unsigned)wc);