commands/move: Fix crash when required args not provided

Fixes #4919.
This commit is contained in:
Jason Nader 2020-01-18 17:57:11 +09:00 committed by Drew DeVault
parent 0bc8d01b1c
commit 3bc209fc9d

View File

@ -923,11 +923,17 @@ struct cmd_results *cmd_move(int argc, char **argv) {
if (strcasecmp(argv[0], "window") == 0 || if (strcasecmp(argv[0], "window") == 0 ||
strcasecmp(argv[0], "container") == 0) { strcasecmp(argv[0], "container") == 0) {
--argc; ++argv; --argc;
if (argc > 0) {
++argv;
}
} }
if (strcasecmp(argv[0], "to") == 0) { if (strcasecmp(argv[0], "to") == 0) {
--argc; ++argv; --argc;
if (argc > 0) {
++argv;
}
} }
if (!argc) { if (!argc) {