diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2015-04-09 21:59:07 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2015-04-09 21:59:07 (GMT) |
commit | f344fbd3ca1a0a32668737e79bfdb06f3fadbba7 (patch) | |
tree | d6b9e25f27b92d752756df7e755e637c80715908 /programs/lz4cli.c | |
parent | 2f8a4c32f998e6440a0b580996ecf8f101df2c74 (diff) | |
download | lz4-f344fbd3ca1a0a32668737e79bfdb06f3fadbba7.zip lz4-f344fbd3ca1a0a32668737e79bfdb06f3fadbba7.tar.gz lz4-f344fbd3ca1a0a32668737e79bfdb06f3fadbba7.tar.bz2 |
Fixed a few warnings from -fsanitize=undefined
Diffstat (limited to 'programs/lz4cli.c')
-rw-r--r-- | programs/lz4cli.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c index 47cf7e0..f33ea82 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -420,11 +420,15 @@ int main(int argc, char** argv) /* Modify Nb Iterations (benchmark only) */ case 'i': - if ((argument[1] >='1') && (argument[1] <='9')) { - int iters = argument[1] - '0'; + unsigned iters = 0; + while ((argument[1] >='0') && (argument[1] <='9')) + { + iters *= 10; + iters += argument[1] - '0'; + argument++; + } BMK_setNbIterations(iters); - argument++; } break; |