mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-22 06:10:06 +00:00
btrfs-progs: unify argc min/max checking, a few more
We don't want to modify argc. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
af83da99d6
commit
d08c73d40c
@ -185,8 +185,7 @@ int cmd_inspect_dump_tree(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
argc = argc - optind;
|
||||
if (check_argc_exact(argc, 1))
|
||||
if (check_argc_exact(argc - optind, 1))
|
||||
usage(cmd_inspect_dump_tree_usage);
|
||||
|
||||
ret = check_arg_type(argv[optind]);
|
||||
|
@ -67,8 +67,7 @@ static int cmd_rescue_chunk_recover(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
argc = argc - optind;
|
||||
if (check_argc_exact(argc, 1))
|
||||
if (check_argc_exact(argc - optind, 1))
|
||||
usage(cmd_rescue_chunk_recover_usage);
|
||||
|
||||
file = argv[optind];
|
||||
@ -133,8 +132,7 @@ static int cmd_rescue_super_recover(int argc, char **argv)
|
||||
usage(cmd_rescue_super_recover_usage);
|
||||
}
|
||||
}
|
||||
argc = argc - optind;
|
||||
if (check_argc_exact(argc, 1))
|
||||
if (check_argc_exact(argc - optind, 1))
|
||||
usage(cmd_rescue_super_recover_usage);
|
||||
|
||||
dname = argv[optind];
|
||||
|
Loading…
Reference in New Issue
Block a user