[Scummvm-devel] eof & err

sunmax at libero.it sunmax at libero.it
Sun Jul 12 21:44:44 CEST 2009


Hi Willem, Johannes,

> calls _input->read(ptr, 0). On the PS2, this then triggers
> the eos flag because of the check you gave.

It's very possible that the check has side fx and that there
are other parts of PS2 FS implementation that are messed up,
but I am a bit dumbstruck here:

are you saying that if somebody is trying to do a fread (even
of size 0) when we are at the end of the file, we should not
set _eof and do an early return?

This looks like something completely legitimate to me.

>> Just returning 0 directly without doing anything when length
>> is 0 is ok.

Ok, I will add this extra condition.

Just to be sure: is that the expected semantics of read (ie,
to return 0 when we are at the end of the file, on a 0 size
read without setting eof?), or we are just hacking it in?

Please let me know,

Thanks!
 -max





More information about the Scummvm-devel mailing list