diff options
author | Yann Collet <cyan@fb.com> | 2016-11-15 22:01:37 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2016-11-15 22:46:57 (GMT) |
commit | d2be69b144d6c5fd9a3dcbc4133e93e710cda998 (patch) | |
tree | 39311a1057f16233f54bccf2f044c6a479c3de74 /programs/lz4io.c | |
parent | 8c32a12f1c50a5561a9efcfe802b5109379a4120 (diff) | |
download | lz4-d2be69b144d6c5fd9a3dcbc4133e93e710cda998.zip lz4-d2be69b144d6c5fd9a3dcbc4133e93e710cda998.tar.gz lz4-d2be69b144d6c5fd9a3dcbc4133e93e710cda998.tar.bz2 |
fixed minor coverity warnings
Diffstat (limited to 'programs/lz4io.c')
-rw-r--r-- | programs/lz4io.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c index 5a366a4..f34d715 100644 --- a/programs/lz4io.c +++ b/programs/lz4io.c @@ -183,10 +183,10 @@ int LZ4IO_setTestMode(int yes) } /* blockSizeID : valid values : 4-5-6-7 */ -int LZ4IO_setBlockSizeID(int bsid) +size_t LZ4IO_setBlockSizeID(unsigned bsid) { - static const int blockSizeTable[] = { 64 KB, 256 KB, 1 MB, 4 MB }; - if ((bsid < minBlockSizeID) || (bsid > maxBlockSizeID)) return -1; + static const size_t blockSizeTable[] = { 64 KB, 256 KB, 1 MB, 4 MB }; + if ((bsid < minBlockSizeID) || (bsid > maxBlockSizeID)) return 0; g_blockSizeId = bsid; return blockSizeTable[g_blockSizeId-minBlockSizeID]; } @@ -777,6 +777,7 @@ static dRess_t LZ4IO_createDResources(void) ress.dstBuffer = malloc(ress.dstBufferSize); if (!ress.srcBuffer || !ress.dstBuffer) EXM_THROW(61, "Allocation error : not enough memory"); + ress.dstFile = NULL; return ress; } |