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>
master
David Sterba 2016-03-09 14:29:29 +01:00
parent af83da99d6
commit d08c73d40c
2 changed files with 3 additions and 6 deletions

View File

@ -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]);

View File

@ -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];