summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid96 <david@hameipe.de>2022-01-08 19:33:19 +0100
committerSimon Ser <contact@emersion.fr>2022-01-09 11:49:53 +0100
commit3ab1c7f15376511d3f76ec8a3c42c3758b8bc2a8 (patch)
tree2d2cb5f6c4f4a10807da7c911755ba4e32aaa5e9
parent828a9a3cfbb14388c13007bbbbcdd7f1ed164eb1 (diff)
commands/move: Fix crash when pos_y is omitted
Fixes #6737 (cherry picked from commit 1bf1d84b7535c3c132240ed7b18414dc6cfe7e8a)
-rw-r--r--sway/commands/move.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index f2702fa17..1a05a7a6f 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -874,6 +874,10 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) {
return cmd_results_new(CMD_INVALID, "Invalid x position specified");
}
+ if (argc < 1) {
+ return cmd_results_new(CMD_FAILURE, expected_position_syntax);
+ }
+
struct movement_amount ly = { .amount = 0, .unit = MOVEMENT_UNIT_INVALID };
// Y direction
num_consumed_args = parse_movement_amount(argc, argv, &ly);