diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-04-29 14:16:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-29 14:16:20 -0400 |
commit | 5e845a38f56a1bea2a11af904665d9312f5b7f89 (patch) | |
tree | 1b50378068c90543520a8833c0e493b5d0ff2b31 /sway | |
parent | 34fae764a5b92d25e5af84431d529d3d46757ff1 (diff) | |
parent | f65a88e68d1ddd606f1a596ed697887c3b3888d0 (diff) |
Merge pull request #1204 from zandrmartin/prevent-layout-auto-crash
prevent crash when `layout auto` is missing args
Diffstat (limited to 'sway')
-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 40ebd590..57a86565 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) { |