mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Correct level handling in zstream recompress.
sscanf returns number of items parsed on success and EOF on failure. Reviewed-by: Adam Moss <[email protected]> Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Rob Norris <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #16198
This commit is contained in:
1 parent
e675852bc1
commit
a043b60f1e
1 file changed
+1
-1
@@ -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) != 1) {
|
||||
fprintf(stderr,
|
||||
"failed to parse level '%s'\n",
|
||||
optarg);
|
||||
|
||||
Reference in new issue
Block a user