X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2F__stdio_exit.c;h=a5e42c675fa90c4edc2ebde2576aaa543ed91a14;hb=37cd1676395e5ebdae3f372bf59d4fef54be9818;hp=5741070f79118c42eced380bff2ce09b877d1071;hpb=ddc947eda311331959c73dbc4491afcfe2326346;p=musl diff --git a/src/stdio/__stdio_exit.c b/src/stdio/__stdio_exit.c index 5741070f..a5e42c67 100644 --- a/src/stdio/__stdio_exit.c +++ b/src/stdio/__stdio_exit.c @@ -9,8 +9,8 @@ static void close_file(FILE *f) { if (!f) return; FFINALLOCK(f); - if (f->wpos > f->wbase) f->write(f, 0, 0); - if (f->rpos < f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR); + if (f->wpos != f->wbase) f->write(f, 0, 0); + if (f->rpos != f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR); } void __stdio_exit(void)