- if (m_file->Eof())
- m_lasterror = wxStream_EOF;
- if (ret == wxInvalidOffset) {
- m_lasterror = wxStream_READ_ERR;
- ret = 0;
- }
+ if ( !ret )
+ {
+ // nothing read, so nothing more to read
+ m_lasterror = wxSTREAM_EOF;
+ }
+ else if ( ret == wxInvalidOffset )
+ {
+ m_lasterror = wxSTREAM_READ_ERROR;
+ ret = 0;
+ }
+ else
+ {
+ // normal case
+ m_lasterror = wxSTREAM_NO_ERROR;
+ }