From a608859c17712086504b8e0eb73058218797b34c Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Sat, 18 Mar 2017 15:57:01 +0200 Subject: [PATCH] Fix off-by-one error when checking workspace_layout arguments --- sway/commands/workspace_layout.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sway/commands/workspace_layout.c b/sway/commands/workspace_layout.c index a2a1a5a243..9ac84be234 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 '");