mirror of https://github.com/axmolengine/axmol.git
Convert return value to what is expected by FileStream::seek
This commit is contained in:
parent
434d2730d6
commit
d76cb66e8e
|
@ -151,7 +151,8 @@ int PosixFileStream::close()
|
|||
|
||||
int PosixFileStream::seek(long offset, int origin)
|
||||
{
|
||||
return static_cast<int>(_iof->seek(_handle, offset, origin));
|
||||
const auto result = _iof->seek(_handle, offset, origin); // this returns -1 for error, and resulting offset on success
|
||||
return result < 0 ? -1 : 0; // return 0 for success
|
||||
}
|
||||
|
||||
int PosixFileStream::read(void* buf, unsigned int size)
|
||||
|
|
Loading…
Reference in New Issue