diff options
author | Jennifer Liu <jenniferliu620@fb.com> | 2018-06-27 00:31:15 (GMT) |
---|---|---|
committer | Jennifer Liu <jenniferliu620@fb.com> | 2018-06-27 00:31:15 (GMT) |
commit | 9ee5183d9bdfd2f39e8ae2e2a4efff25e61c226d (patch) | |
tree | 59ec2b0211f3a037c81703e6ad22d1d6d307813d /programs | |
parent | fd1d59f7ba5ed24d973b7569511b7162978d3e46 (diff) | |
download | lz4-9ee5183d9bdfd2f39e8ae2e2a4efff25e61c226d.zip lz4-9ee5183d9bdfd2f39e8ae2e2a4efff25e61c226d.tar.gz lz4-9ee5183d9bdfd2f39e8ae2e2a4efff25e61c226d.tar.bz2 |
Fixed code based on comments from pull request
Diffstat (limited to 'programs')
-rw-r--r-- | programs/bench.c | 2 | ||||
-rw-r--r-- | programs/lz4cli.c | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/programs/bench.c b/programs/bench.c index 1ab1b92..770191c 100644 --- a/programs/bench.c +++ b/programs/bench.c @@ -407,6 +407,8 @@ static void BMK_benchCLevel(void* srcBuffer, size_t benchedSize, if (g_displayLevel == 1 && !g_additionalParam) DISPLAY("bench %s %s: input %u bytes, %u seconds, %u KB blocks\n", LZ4_VERSION_STRING, LZ4_GIT_COMMIT_STRING, (U32)benchedSize, g_nbSeconds, (U32)(g_blockSize>>10)); + if (cLevelLast < cLevel) cLevelLast = cLevel; + for (l=cLevel; l <= cLevelLast; l++) { BMK_benchMem(srcBuffer, benchedSize, displayName, l, diff --git a/programs/lz4cli.c b/programs/lz4cli.c index 94e3b14..669b585 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -288,8 +288,6 @@ static unsigned longCommandWArg(const char** stringPtr, const char* longCommand) typedef enum { om_auto, om_compress, om_decompress, om_test, om_bench } operationMode_e; -#define CLEAN_RETURN(i) { operationResult = (i); goto _cleanup; } - int main(int argc, const char** argv) { int i, @@ -380,7 +378,7 @@ int main(int argc, const char** argv) if (!strcmp(argument, "--keep")) { LZ4IO_setRemoveSrcFile(0); continue; } /* keep source file (default) */ if (!strcmp(argument, "--rm")) { LZ4IO_setRemoveSrcFile(1); continue; } if (longCommandWArg(&argument, "--fast")) { - /* Parse optional window log */ + /* Parse optional acceleration factor */ if (*argument == '=') { U32 fastLevel; ++argument; @@ -388,9 +386,12 @@ int main(int argc, const char** argv) if (fastLevel) { cLevel = -(int)fastLevel; } + else { + badusage(exeName); + } } else if (*argument != 0) { /* Invalid character following --fast */ - CLEAN_RETURN(badusage(exeName)); + badusage(exeName); } else { cLevel = -1; /* default for --fast */ } |