btrfs-progs: use check_argc_exact to check arg number of btrfs-rescue

The btrfs-rescue accepts exactly one arg for both
chunk-recover & super-recover, use check_argc_exact clearly.

Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
Gui Hecheng 2014-05-15 09:29:09 +08:00 committed by David Sterba
parent bddb8e0fd7
commit da65695cc5
1 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ int cmd_chunk_recover(int argc, char *argv[])
} }
argc = argc - optind; argc = argc - optind;
if (argc == 0) if (check_argc_exact(argc, 1))
usage(cmd_chunk_recover_usage); usage(cmd_chunk_recover_usage);
file = argv[optind]; file = argv[optind];
@ -132,7 +132,7 @@ int cmd_super_recover(int argc, char **argv)
} }
} }
argc = argc - optind; argc = argc - optind;
if (argc != 1) if (check_argc_exact(argc, 1))
usage(cmd_super_recover_usage); usage(cmd_super_recover_usage);
dname = argv[optind]; dname = argv[optind];