fix incorrect argument checking for "btrfs sub snap -r"
authorHugo Mills <hugo@carfax.org.uk>
Sat, 9 Jul 2011 17:50:23 +0000 (18:50 +0100)
committerChris Mason <chris.mason@oracle.com>
Tue, 25 Oct 2011 13:18:59 +0000 (09:18 -0400)
Stephane Chazelas and Andreas Philipp spotted that the earlier patch
fixing this issue was incomplete, and should also update the argument-
count checking code as well.

Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
btrfs_cmds.c

index d91bccd..699dfc2 100644 (file)
@@ -372,7 +372,7 @@ int do_clone(int argc, char **argv)
                        return 1;
                }
        }
-       if (argc - optind < 2) {
+       if (argc - optind != 2) {
                fprintf(stderr, "Invalid arguments for subvolume snapshot\n");
                free(argv);
                return 1;