mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Fix the return value of FS_Seek
It returns a negative value on failure, so handle that properly
This commit is contained in:
parent
c76dda1523
commit
5403577642
7 changed files with 9 additions and 9 deletions
|
@ -1710,7 +1710,7 @@ FS_Seek
|
|||
|
||||
=================
|
||||
*/
|
||||
int FS_Seek( fileHandle_t f, long offset, fsOrigin_t origin ) {
|
||||
int FS_Seek( fileHandle_t f, long offset, int origin ) {
|
||||
int _origin;
|
||||
|
||||
if ( !fs_searchpaths ) {
|
||||
|
@ -1758,7 +1758,7 @@ int FS_Seek( fileHandle_t f, long offset, fsOrigin_t origin ) {
|
|||
switch( origin ) {
|
||||
case FS_SEEK_SET:
|
||||
if ( remainder == currentPosition ) {
|
||||
return 0;
|
||||
return offset;
|
||||
}
|
||||
unzSetOffset(fsh[f].handleFiles.file.z, fsh[f].zipFilePos);
|
||||
unzOpenCurrentFile(fsh[f].handleFiles.file.z);
|
||||
|
@ -1771,7 +1771,7 @@ int FS_Seek( fileHandle_t f, long offset, fsOrigin_t origin ) {
|
|||
remainder -= PK3_SEEK_BUFFER_SIZE;
|
||||
}
|
||||
FS_Read( buffer, remainder, f );
|
||||
return 0;
|
||||
return offset;
|
||||
|
||||
default:
|
||||
Com_Error( ERR_FATAL, "Bad origin in FS_Seek" );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue