fflush(3) on fseeko(3).

This caused a corruption of the resulting file if the program fwrite some
data that is buffered, then fseeks, and then fflushes. The fwrite will then
happen at the wrong memory location. Flushing in fseeko(3) fixes the problem
but it may cause violate some standard or just be inefficient.
This commit is contained in:
Jonas 'Sortie' Termansen 2012-09-07 12:41:10 +02:00
parent 910197ffa7
commit a478dda4d9
1 changed files with 1 additions and 0 deletions

View File

@ -27,5 +27,6 @@
extern "C" int fseeko(FILE* fp, off_t offset, int whence)
{
fp->numpushedback = 0;
fflush(fp);
return (fp->seek_func) ? fp->seek_func(fp->user, offset, whence) : 0;
}