mirror of
https://github.com/ladislav-zezula/StormLib.git
synced 2026-01-23 07:55:27 +01:00
Add brackets in SFileSetFilePointer when pointer < 0
This addresses a bug introduced in:
- fe652fe4a6
Brackets were not properly included, causing `SFILE_INVALID_POS` to be
returned whenever `DeltaPos` was less than zero, instead of only when
the resulting position was negative.
This commit is contained in:
@@ -868,8 +868,10 @@ DWORD WINAPI SFileSetFilePointer(HANDLE hFile, LONG lFilePos, LONG * plFilePosHi
|
||||
if((LONGLONG)DeltaPos < 0)
|
||||
{
|
||||
if(NewPosition > FileSize) // Position is negative
|
||||
{
|
||||
SetLastError(ERROR_NEGATIVE_SEEK);
|
||||
return SFILE_INVALID_POS;
|
||||
}
|
||||
}
|
||||
|
||||
// If moving forward, don't allow the new position go past the end of the file
|
||||
|
||||
Reference in New Issue
Block a user