diff options
author | 2020-01-18 17:57:11 +0900 | |
---|---|---|
committer | 2020-01-18 10:36:03 +0100 | |
commit | 450b40c6356413628937dbcbba16bd7f1544111b (patch) | |
tree | fc0084dc35bd08a3a9d17f5470d4668363024f2b /sway | |
parent | output: apply oc to outputs using wl_for_each_safe (diff) | |
download | sway-450b40c6356413628937dbcbba16bd7f1544111b.tar.gz sway-450b40c6356413628937dbcbba16bd7f1544111b.tar.zst sway-450b40c6356413628937dbcbba16bd7f1544111b.zip |
commands/move: Fix crash when required args not provided
Fixes #4919.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/move.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index 09a47652..ceeab07c 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -923,11 +923,17 @@ struct cmd_results *cmd_move(int argc, char **argv) { | |||
923 | 923 | ||
924 | if (strcasecmp(argv[0], "window") == 0 || | 924 | if (strcasecmp(argv[0], "window") == 0 || |
925 | strcasecmp(argv[0], "container") == 0) { | 925 | strcasecmp(argv[0], "container") == 0) { |
926 | --argc; ++argv; | 926 | --argc; |
927 | if (argc > 0) { | ||
928 | ++argv; | ||
929 | } | ||
927 | } | 930 | } |
928 | 931 | ||
929 | if (strcasecmp(argv[0], "to") == 0) { | 932 | if (strcasecmp(argv[0], "to") == 0) { |
930 | --argc; ++argv; | 933 | --argc; |
934 | if (argc > 0) { | ||
935 | ++argv; | ||
936 | } | ||
931 | } | 937 | } |
932 | 938 | ||
933 | if (!argc) { | 939 | if (!argc) { |