aboutsummaryrefslogtreecommitdiff
path: root/src/SFileReadFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SFileReadFile.cpp')
-rw-r--r--src/SFileReadFile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SFileReadFile.cpp b/src/SFileReadFile.cpp
index 485b361..f91d2af 100644
--- a/src/SFileReadFile.cpp
+++ b/src/SFileReadFile.cpp
@@ -867,8 +867,8 @@ DWORD WINAPI SFileSetFilePointer(HANDLE hFile, LONG lFilePos, LONG * plFilePosHi
// If moving backward, don't allow the new position go negative
if((LONGLONG)DeltaPos < 0)
{
- if(NewPosition > FileSize)
- NewPosition = 0;
+ if(NewPosition > FileSize) // Position is negative
+ return SFILE_INVALID_POS;
}
// If moving forward, don't allow the new position go past the end of the file