diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-03-18 16:36:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-18 16:36:17 -0400 |
commit | 5c3d3184a3241c3d30af3ec4a12522c2a7f3d297 (patch) | |
tree | 23256a4f23d2c64925b3767db49d413225e1a1fe /sway | |
parent | b01e8dea5866d4fb0ff0823511d47d223876fe07 (diff) | |
parent | e956c61719d172f8053029e85dda046e99e8c235 (diff) | |
download | sway-5c3d3184a3241c3d30af3ec4a12522c2a7f3d297.tar.xz |
Merge pull request #1119 from oranenj/master
Fix off-by-one error when checking workspace_layout arguments
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/workspace_layout.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/commands/workspace_layout.c b/sway/commands/workspace_layout.c index a2a1a5a2..9ac84be2 100644 --- a/sway/commands/workspace_layout.c +++ b/sway/commands/workspace_layout.c @@ -21,13 +21,13 @@ struct cmd_results *cmd_workspace_layout(int argc, char **argv) { if ((error = checkarg(argc, "workspace_layout auto", EXPECTED_EQUAL_TO, 2))) { return error; } - if (strcasecmp(argv[0], "left") == 0) { + if (strcasecmp(argv[1], "left") == 0) { config->default_layout = L_AUTO_LEFT; - } else if (strcasecmp(argv[0], "right") == 0) { + } else if (strcasecmp(argv[1], "right") == 0) { config->default_layout = L_AUTO_RIGHT; - } else if (strcasecmp(argv[0], "top") == 0) { + } else if (strcasecmp(argv[1], "top") == 0) { config->default_layout = L_AUTO_TOP; - } else if (strcasecmp(argv[0], "bottom") == 0) { + } else if (strcasecmp(argv[1], "bottom") == 0) { config->default_layout = L_AUTO_BOTTOM; } else { return cmd_results_new(CMD_INVALID, "workspace_layout auto", "Expected 'workspace_layout auto <left|right|top|bottom>'"); |