Skip to content

Commit

Permalink
commands/move: Fix crash when required args not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
ammgws authored and emersion committed Jan 18, 2020
1 parent 9d827ef commit 450b40c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sway/commands/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,11 +923,17 @@ struct cmd_results *cmd_move(int argc, char **argv) {

if (strcasecmp(argv[0], "window") == 0 ||
strcasecmp(argv[0], "container") == 0) {
--argc; ++argv;
--argc;
if (argc > 0) {
++argv;
}
}

if (strcasecmp(argv[0], "to") == 0) {
--argc; ++argv;
--argc;
if (argc > 0) {
++argv;
}
}

if (!argc) {
Expand Down

0 comments on commit 450b40c

Please sign in to comment.