diff options
author | Jarkko Oranen <oranenj@iki.fi> | 2017-03-18 22:24:44 +0200 |
---|---|---|
committer | Jarkko Oranen <oranenj@iki.fi> | 2017-03-18 22:24:44 +0200 |
commit | f6196b7e9a2d4b7b4ce326820b568031a74ff089 (patch) | |
tree | 9acabc374913b40bf49561b04a7a49816efd709b /sway/commands/workspace_layout.c | |
parent | Merge pull request #1117 from jnsaff/master (diff) | |
download | sway-f6196b7e9a2d4b7b4ce326820b568031a74ff089.tar.gz sway-f6196b7e9a2d4b7b4ce326820b568031a74ff089.tar.zst sway-f6196b7e9a2d4b7b4ce326820b568031a74ff089.zip |
Fix off-by-one error when checking workspace_layout arguments
Diffstat (limited to 'sway/commands/workspace_layout.c')
-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) { | |||
21 | if ((error = checkarg(argc, "workspace_layout auto", EXPECTED_EQUAL_TO, 2))) { | 21 | if ((error = checkarg(argc, "workspace_layout auto", EXPECTED_EQUAL_TO, 2))) { |
22 | return error; | 22 | return error; |
23 | } | 23 | } |
24 | if (strcasecmp(argv[0], "left") == 0) { | 24 | if (strcasecmp(argv[1], "left") == 0) { |
25 | config->default_layout = L_AUTO_LEFT; | 25 | config->default_layout = L_AUTO_LEFT; |
26 | } else if (strcasecmp(argv[0], "right") == 0) { | 26 | } else if (strcasecmp(argv[1], "right") == 0) { |
27 | config->default_layout = L_AUTO_RIGHT; | 27 | config->default_layout = L_AUTO_RIGHT; |
28 | } else if (strcasecmp(argv[0], "top") == 0) { | 28 | } else if (strcasecmp(argv[1], "top") == 0) { |
29 | config->default_layout = L_AUTO_TOP; | 29 | config->default_layout = L_AUTO_TOP; |
30 | } else if (strcasecmp(argv[0], "bottom") == 0) { | 30 | } else if (strcasecmp(argv[1], "bottom") == 0) { |
31 | config->default_layout = L_AUTO_BOTTOM; | 31 | config->default_layout = L_AUTO_BOTTOM; |
32 | } else { | 32 | } else { |
33 | return cmd_results_new(CMD_INVALID, "workspace_layout auto", "Expected 'workspace_layout auto <left|right|top|bottom>'"); | 33 | return cmd_results_new(CMD_INVALID, "workspace_layout auto", "Expected 'workspace_layout auto <left|right|top|bottom>'"); |