diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-03-18 16:36:17 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-04-03 10:59:33 -0400 |
commit | 76891651061185fd6c8cb2318fb7df388a43124c (patch) | |
tree | 5c814e1d80e3e61023e62195b501bc054475bd42 | |
parent | Merge pull request #1117 from jnsaff/master (diff) | |
download | sway-76891651061185fd6c8cb2318fb7df388a43124c.tar.gz sway-76891651061185fd6c8cb2318fb7df388a43124c.tar.zst sway-76891651061185fd6c8cb2318fb7df388a43124c.zip |
Merge pull request #1119 from oranenj/master
Fix off-by-one error when checking workspace_layout arguments
-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 c9305773..3da5a7a7 100644 --- a/sway/commands/workspace_layout.c +++ b/sway/commands/workspace_layout.c | |||
@@ -20,13 +20,13 @@ struct cmd_results *cmd_workspace_layout(int argc, char **argv) { | |||
20 | if ((error = checkarg(argc, "workspace_layout auto", EXPECTED_EQUAL_TO, 2))) { | 20 | if ((error = checkarg(argc, "workspace_layout auto", EXPECTED_EQUAL_TO, 2))) { |
21 | return error; | 21 | return error; |
22 | } | 22 | } |
23 | if (strcasecmp(argv[0], "left") == 0) { | 23 | if (strcasecmp(argv[1], "left") == 0) { |
24 | config->default_layout = L_AUTO_LEFT; | 24 | config->default_layout = L_AUTO_LEFT; |
25 | } else if (strcasecmp(argv[0], "right") == 0) { | 25 | } else if (strcasecmp(argv[1], "right") == 0) { |
26 | config->default_layout = L_AUTO_RIGHT; | 26 | config->default_layout = L_AUTO_RIGHT; |
27 | } else if (strcasecmp(argv[0], "top") == 0) { | 27 | } else if (strcasecmp(argv[1], "top") == 0) { |
28 | config->default_layout = L_AUTO_TOP; | 28 | config->default_layout = L_AUTO_TOP; |
29 | } else if (strcasecmp(argv[0], "bottom") == 0) { | 29 | } else if (strcasecmp(argv[1], "bottom") == 0) { |
30 | config->default_layout = L_AUTO_BOTTOM; | 30 | config->default_layout = L_AUTO_BOTTOM; |
31 | } else { | 31 | } else { |
32 | return cmd_results_new(CMD_INVALID, "workspace_layout auto", "Expected 'workspace_layout auto <left|right|top|bottom>'"); | 32 | return cmd_results_new(CMD_INVALID, "workspace_layout auto", "Expected 'workspace_layout auto <left|right|top|bottom>'"); |