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.
This commit is contained in:
Furkan Sahin 2025-04-24 15:41:20 -04:00 committed by Simon Ser
parent 38a42f97d4
commit 5b8874e3f4

View file

@ -457,7 +457,7 @@ static struct cmd_results *cmd_resize_set(int argc, char **argv) {
if (argc > num_consumed_args) {
return cmd_results_new(CMD_INVALID, "%s", usage);
}
if (width.unit == MOVEMENT_UNIT_INVALID) {
if (height.unit == MOVEMENT_UNIT_INVALID) {
return cmd_results_new(CMD_INVALID, "%s", usage);
}
}