[Scummvm-devel] eof & err
Willem Jan Palenstijn
wjp at usecode.org
Sun Jul 12 20:57:28 CEST 2009
On Sun, Jul 12, 2009 at 04:45:44PM +0000, Willem Jan Palenstijn wrote:
> On Sun, Jul 12, 2009 at 06:42:50PM +0200, sunmax at libero.it wrote:
> > Hi Johannes,
> >
> > thanks for your feedback.
> >
> > [ In TIMInterpreter::load ]
> >
> > if (stream->err())
> > error("Read error while parsing file '%s", filename);
> >
> > Yes. That's the spot.
> >
> > Here is the diagnosis:
> >
> > - on PS2 _eof (returned by ->err()) is set when you seek or
> > read past the end of a file, but even when you just read
> > all the file
> >
> > if (_filePos >= _fileSize) {
> > _eof = true;
> > ...
>
> That code is _before_ reading, though, so that should be ok.
Correction: kyra does a couple of reads of length 0.
What happens if you just remove that check? The length>0 cases should be
covered by the check after it.
-Willem Jan
More information about the Scummvm-devel
mailing list