check number of args for btrfs sub snap correctly

Check whether there are the right number of arguments (exatly 2 without
the flag -r) in the subcommand handler for the btrfs subvolume snapshot
command.

Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
This commit is contained in:
Andreas Philipp 2011-08-11 08:45:40 +02:00 committed by Chris Mason
parent a70b0b2bba
commit a8b624eae7

View File

@ -372,7 +372,7 @@ int do_clone(int argc, char **argv)
return 1;
}
}
if (argc - optind != 2) {
if (argc - optind != 3) {
fprintf(stderr, "Invalid arguments for subvolume snapshot\n");
free(argv);
return 1;