]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
blindfix for Windows conversion warning
authorYann Collet <cyan@fb.com>
Sat, 19 Aug 2017 00:06:12 +0000 (17:06 -0700)
committerYann Collet <cyan@fb.com>
Sat, 19 Aug 2017 00:06:12 +0000 (17:06 -0700)
long type is 32-bits on Windows 64,
while it's 64-bits on Unix.
64-to-32 shortening conversion for long is a specific Windows issue.

programs/fileio.c

index 3db6af7346ec5cb71417bde8fdc4d0bf8d6d9501..9f9b72fb0dad1f806f91be972bbe51fc1ea4fce2 100644 (file)
@@ -1038,7 +1038,7 @@ static int getFileInfo(fileInfo_t* info, const char* inFileName){
             /* Skippable frame */
             else if ((magicNumber & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) {
                 U32 const frameSize = MEM_readLE32(headerBuffer + 4);
-                long const seek = -numBytesRead + 8 + frameSize;
+                long const seek = (long)(8 + frameSize - numBytesRead);
                 int const ret = LONG_SEEK(srcFile, seek, SEEK_CUR);
                 if (ret != 0) {
                     DISPLAY("Error: could not find end of skippable frame\n");