aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-image.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-03-01 16:29:16 +0100
committerDavid Sterba <dsterba@suse.com>2016-03-14 13:42:47 +0100
commit358807cc33fb3ed50ddf782e5b32f6e3cc2fa329 (patch)
tree51956616bec899d08dd7d9ca46ed9bf9b6682f55 /btrfs-image.c
parent6398ed78f9d52769954ba5fe3c15452c390397a7 (diff)
downloadbtrfs-progs-358807cc33fb3ed50ddf782e5b32f6e3cc2fa329.tar.gz
btrfs-progs-358807cc33fb3ed50ddf782e5b32f6e3cc2fa329.tar.xz
btrfs-progs-358807cc33fb3ed50ddf782e5b32f6e3cc2fa329.zip
btrfs-progs: unify argc min/max checking
We don't want to modify argc. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-image.c')
-rw-r--r--btrfs-image.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/btrfs-image.c b/btrfs-image.c
index c7fa18f..33966fd 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -2735,12 +2735,11 @@ int main(int argc, char *argv[])
}
}
- argc = argc - optind;
set_argv0(argv);
- if (check_argc_min(argc, 2))
+ if (check_argc_min(argc - optind, 2))
print_usage(1);
- dev_cnt = argc - 1;
+ dev_cnt = argc - optind - 1;
if (create) {
if (old_restore) {