1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

better error handling

This commit is contained in:
Yann Collet
2016-09-09 19:33:56 +02:00
parent 746b51de51
commit a2664649df
8 changed files with 21 additions and 17 deletions

View File

@ -53,7 +53,7 @@ static void* loadFile_X(const char* fileName, size_t* size)
printf("fread: %s : %s \n", fileName, strerror(errno));
exit(4);
}
fclose(inFile);
fclose(inFile); /* can't fail (read only) */
*size = buffSize;
return buffer;
}
@ -68,7 +68,7 @@ static void decompress(const char* fname)
printf("%s : original size unknown \n", fname);
exit(5);
}
void* const rBuff = malloc_X(rSize);
void* const rBuff = malloc_X((size_t)rSize);
size_t const dSize = ZSTD_decompress(rBuff, rSize, cBuff, cSize);