summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-03-09 14:29:29 +0100
committerDavid Sterba <dsterba@suse.com>2016-03-14 13:42:47 +0100
commitd08c73d40c9f25ef2d58d3f245e2ada7c8117a35 (patch)
treeefabc36fe498968d22b5f9a110bd4ad98b7fbac1
parentaf83da99d6f3dc5e50db783864effb4ae81f15bc (diff)
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>
-rw-r--r--cmds-inspect-dump-tree.c3
-rw-r--r--cmds-rescue.c6
2 files changed, 3 insertions, 6 deletions
diff --git a/cmds-inspect-dump-tree.c b/cmds-inspect-dump-tree.c
index 17f9700..39c5818 100644
--- a/cmds-inspect-dump-tree.c
+++ b/cmds-inspect-dump-tree.c
@@ -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]);
diff --git a/cmds-rescue.c b/cmds-rescue.c
index cacb144..f597997 100644
--- a/cmds-rescue.c
+++ b/cmds-rescue.c
@@ -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];