Skip to content

Commit 5b8874e

Browse files
sahinfemersion
authored andcommitted
sway/commands: Handle incorrect resize unit
problem: an invalid usage of the command resize set will cause sway to crash because it doesn't check for an invalid height. solution: validate height along with width.
1 parent 38a42f9 commit 5b8874e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sway/commands/resize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ static struct cmd_results *cmd_resize_set(int argc, char **argv) {
457457
if (argc > num_consumed_args) {
458458
return cmd_results_new(CMD_INVALID, "%s", usage);
459459
}
460-
if (width.unit == MOVEMENT_UNIT_INVALID) {
460+
if (height.unit == MOVEMENT_UNIT_INVALID) {
461461
return cmd_results_new(CMD_INVALID, "%s", usage);
462462
}
463463
}

0 commit comments

Comments
 (0)