diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-04-29 14:16:20 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-05-01 10:25:23 -0400 |
commit | 3642e9d7efae423f9e222b304de1a0acb1e8eb78 (patch) | |
tree | b19248cb9508c376033036bfce1f689b38a8209a | |
parent | 27c725ecede9beea7868b5196715d131fca95285 (diff) | |
download | sway-3642e9d7efae423f9e222b304de1a0acb1e8eb78.zip sway-3642e9d7efae423f9e222b304de1a0acb1e8eb78.tar.gz sway-3642e9d7efae423f9e222b304de1a0acb1e8eb78.tar.bz2 |
Merge pull request #1204 from zandrmartin/prevent-layout-auto-crash
prevent crash when `layout auto` is missing args
-rw-r--r-- | sway/commands/layout.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/layout.c b/sway/commands/layout.c index 40ebd59..57a8656 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) { |