]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed gz error reporting
authorYann Collet <cyan@fb.com>
Mon, 3 Jul 2017 20:47:46 +0000 (13:47 -0700)
committerYann Collet <cyan@fb.com>
Mon, 3 Jul 2017 20:47:46 +0000 (13:47 -0700)
programs/fileio.c

index 1d98e474a8749cccdfce79a3b0cb205376f58a36..2557c08e8087c9dc450c6895348835e081f274a8 100644 (file)
@@ -1679,9 +1679,9 @@ static int FIO_decompressFrames(dRess_t ress, FILE* srcFile,
         }
         if (buf[0] == 31 && buf[1] == 139) { /* gz magic number */
 #ifdef ZSTD_GZDECOMPRESS
-            unsigned long long const result = FIO_decompressGzFrame(&ress, srcFile, srcFileName);
-            if (result == 0) return 1;
-            filesize += result;
+            unsigned long long const frameSize = FIO_decompressGzFrame(&ress, srcFile, srcFileName);
+            if (frameSize == FIO_ERROR_FRAME_DECODING) return 1;
+            filesize += frameSize;
 #else
             DISPLAYLEVEL(1, "zstd: %s: gzip file cannot be uncompressed (zstd compiled without HAVE_ZLIB) -- ignored \n", srcFileName);
             return 1;