提交 bd674673 编写于 作者: R Rich Felker

fix undefined call order in fclose, possible lost output depending on compiler

pcc turned up this bug by calling f->close(f) before fflush(f),
resulting in lost output and error on flush.
上级 a9be201c
......@@ -13,7 +13,7 @@ int fclose(FILE *f)
OFLUNLOCK();
}
r = fflush(f) | f->close(f);
r = -(fflush(f) || f->close(f));
if (!perm) free(f);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册