提交 05b69402 编写于 作者: R Rich Felker

fix getc - the classic error of trying to store EOF+0-255 in a char type..

上级 e3cd6c5c
......@@ -5,7 +5,7 @@
int __uflow(FILE *f)
{
unsigned char c = EOF;
if (f->rend || !__toread(f)) f->read(f, &c, 1);
return c;
unsigned char c;
if ((f->rend || !__toread(f)) && f->read(f, &c, 1)==1) return c;
return EOF;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册