From f9bde0030dd12d1afd8dd6378f099944727561cf Mon Sep 17 00:00:00 2001 From: Konstantin Pospelov Date: Sun, 25 Nov 2018 15:16:45 +0300 Subject: [PATCH] resize set: add assertion for an invalid unit --- sway/commands/resize.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/commands/resize.c b/sway/commands/resize.c index bafaea878..cf5dea021 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c @@ -524,7 +524,9 @@ static struct cmd_results *resize_set_floating(struct sway_container *con, grow_width = width->amount - con->width; con->x -= grow_width / 2; con->width = width->amount; + break; case RESIZE_UNIT_INVALID: + sway_assert(false, "invalid width unit"); break; } } @@ -542,7 +544,9 @@ static struct cmd_results *resize_set_floating(struct sway_container *con, grow_height = height->amount - con->height; con->y -= grow_height / 2; con->height = height->amount; + break; case RESIZE_UNIT_INVALID: + sway_assert(false, "invalid height unit"); break; } }