Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix off-by-one error when checking workspace_layout arguments #1119

Merged
merged 2 commits into from
Mar 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sway/commands/workspace_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>'");
Expand Down