diff options
author | Ladislav Zezula <zezula@volny.cz> | 2017-08-28 11:06:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-28 11:06:20 +0200 |
commit | 0b72bdfa3a14c856b20ecf64d5a94cdaf03c2d1f (patch) | |
tree | 6caa61bf549cceb233cfb48fb2d1c596938605a3 /src | |
parent | adac4aa0f586c7aa2a3c19aa4e687d827dc86195 (diff) | |
parent | 951f416398b3aa0b32969b4a391a3103443ad99e (diff) |
Merge pull request #110 from Lectem/patch-2
SFileSetFilePointer error when new pointer is <0
Diffstat (limited to 'src')
-rw-r--r-- | src/SFileReadFile.cpp | 4 |
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 |