summaryrefslogtreecommitdiffstats
path: root/programs/bench.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2016-11-15 22:01:37 (GMT)
committerYann Collet <cyan@fb.com>2016-11-15 22:46:57 (GMT)
commitd2be69b144d6c5fd9a3dcbc4133e93e710cda998 (patch)
tree39311a1057f16233f54bccf2f044c6a479c3de74 /programs/bench.c
parent8c32a12f1c50a5561a9efcfe802b5109379a4120 (diff)
downloadlz4-d2be69b144d6c5fd9a3dcbc4133e93e710cda998.zip
lz4-d2be69b144d6c5fd9a3dcbc4133e93e710cda998.tar.gz
lz4-d2be69b144d6c5fd9a3dcbc4133e93e710cda998.tar.bz2
fixed minor coverity warnings
Diffstat (limited to 'programs/bench.c')
-rw-r--r--programs/bench.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/programs/bench.c b/programs/bench.c
index cfd60db..434da8b 100644
--- a/programs/bench.c
+++ b/programs/bench.c
@@ -260,6 +260,7 @@ static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
cSize = 0;
{ U32 blockNb; for (blockNb=0; blockNb<nbBlocks; blockNb++) cSize += blockTable[blockNb].cSize; }
+ cSize += !cSize; /* avoid div by 0 */
ratio = (double)srcSize / (double)cSize;
markNb = (markNb+1) % NB_MARKS;
DISPLAYLEVEL(2, "%2s-%-17.17s :%10u ->%10u (%5.3f),%6.1f MB/s\r",