Correct level handling in zstream recompress.
sscanf returns number of items parsed on success and EOF on failure. Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
This commit is contained in:
parent
04bae5ec95
commit
1ccd214772
|
@ -77,7 +77,7 @@ zstream_do_recompress(int argc, char *argv[])
|
|||
while ((c = getopt(argc, argv, "l:")) != -1) {
|
||||
switch (c) {
|
||||
case 'l':
|
||||
if (sscanf(optarg, "%d", &level) != 0) {
|
||||
if (sscanf(optarg, "%d", &level) == EOF) {
|
||||
fprintf(stderr,
|
||||
"failed to parse level '%s'\n",
|
||||
optarg);
|
||||
|
|
Loading…
Reference in New Issue