btrfs-progs: qgroup assign: set path after checking argument count
authorDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2015 14:16:52 +0000 (16:16 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 31 Aug 2015 17:25:11 +0000 (19:25 +0200)
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-qgroup.c

index 6436e9c69e9aee8682e46fb87ad5041122cfd9e4..f2200b7ec469ea009fc569bc0410fd757e67cf08 100644 (file)
@@ -37,7 +37,7 @@ static int qgroup_assign(int assign, int argc, char **argv)
        int ret = 0;
        int fd;
        int e;
-       char *path = argv[3];
+       char *path;
        struct btrfs_ioctl_qgroup_assign_args args;
        DIR *dirstream = NULL;
 
@@ -49,6 +49,8 @@ static int qgroup_assign(int assign, int argc, char **argv)
        args.src = parse_qgroupid(argv[1]);
        args.dst = parse_qgroupid(argv[2]);
 
+       path = argv[3];
+
        /*
         * FIXME src should accept subvol path
         */