added error check

This commit is contained in:
Yann Collet 2016-09-20 11:59:12 +02:00
parent 86bdcd83c1
commit 47f3697f32

View File

@ -80,6 +80,7 @@ static void decompressFile_orDie(const char* fname)
while (input.pos < input.size) {
ZSTD_outBuffer output = { buffOut, buffOutSize, 0 };
toRead = ZSTD_decompressStream(dstream, &output , &input); /* toRead : size of next compressed block */
if (ZSTD_isError(toRead)) { fprintf(stderr, "ZSTD_decompressStream() error : %s \n", ZSTD_getErrorName(toRead)); exit(12); }
fwrite_orDie(buffOut, output.pos, fout);
}
}