summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2018-04-27 13:55:46 +0200
committerGitHub <noreply@github.com>2018-04-27 13:55:46 +0200
commiteecbac1689b1f7ea09c93812ba1f4d51a3436bb7 (patch)
tree4718cffa9d42487b3bb540b7f393d5a3dda1ed49 /src
parent8c9992253dca5861388e54506d40e5cbefaf2485 (diff)
parentfe652fe4a6e02041194a0f1b29a0086bd99fb14d (diff)
Merge pull request #129 from nvs/fix-error-negative-seek
I looked at your proposed changes and yes, they are OK. Thank you for the bugfix.
Diffstat (limited to 'src')
-rw-r--r--src/SFileReadFile.cpp1
-rw-r--r--src/StormPort.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/SFileReadFile.cpp b/src/SFileReadFile.cpp
index f91d2af..3831165 100644
--- a/src/SFileReadFile.cpp
+++ b/src/SFileReadFile.cpp
@@ -868,6 +868,7 @@ 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;
}
diff --git a/src/StormPort.h b/src/StormPort.h
index 40e418c..1da974b 100644
--- a/src/StormPort.h
+++ b/src/StormPort.h
@@ -211,6 +211,7 @@
#define ERROR_NOT_ENOUGH_MEMORY ENOMEM
#define ERROR_NOT_SUPPORTED ENOTSUP
#define ERROR_INVALID_PARAMETER EINVAL
+ #define ERROR_NEGATIVE_SEEK EINVAL
#define ERROR_DISK_FULL ENOSPC
#define ERROR_ALREADY_EXISTS EEXIST
#define ERROR_INSUFFICIENT_BUFFER ENOBUFS