From 3642e9d7efae423f9e222b304de1a0acb1e8eb78 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 29 Apr 2017 14:16:20 -0400 Subject: [PATCH] Merge pull request #1204 from zandrmartin/prevent-layout-auto-crash prevent crash when `layout auto` is missing args --- sway/commands/layout.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/commands/layout.c b/sway/commands/layout.c index 40ebd5903..57a865654 100644 --- a/sway/commands/layout.c +++ b/sway/commands/layout.c @@ -85,6 +85,10 @@ static struct cmd_results *cmd_layout_auto(swayc_t *container, int argc, char ** enum swayc_layouts old_layout = container->layout; enum swayc_layouts layout = old_layout; + if ((error = checkarg(argc, "layout auto", EXPECTED_MORE_THAN, 1))) { + return error; + } + if (strcasecmp(argv[1], "left") == 0) { layout = L_AUTO_LEFT; } else if (strcasecmp(argv[1], "right") == 0) {