diff options
author | emersion <contact@emersion.fr> | 2018-05-03 14:04:09 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-05-03 14:04:39 +0100 |
commit | 29224e7aec774446bbf0e2b40afe1983b8037651 (patch) | |
tree | f71f79bb14fa6257397cde8e7973e48138400653 | |
parent | 4fd3996d7761c8ff4716463ffe18399a8894577e (diff) |
Fix segfault when running the resize command without arguments
-rw-r--r-- | sway/commands/resize.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/commands/resize.c b/sway/commands/resize.c index d1f9e019..29637953 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c @@ -219,15 +219,17 @@ struct cmd_results *cmd_resize(int argc, char **argv) { return cmd_results_new(CMD_INVALID, "resize", "Can only resize views/containers"); } + + struct cmd_results *error; + if ((error = checkarg(argc, "resize", EXPECTED_AT_LEAST, 2))) { + return error; + } + if (strcasecmp(argv[0], "set") == 0) { // TODO //return cmd_resize_set(argc - 1, &argv[1]); return cmd_results_new(CMD_INVALID, "resize", "resize set unimplemented"); } - struct cmd_results *error; - if ((error = checkarg(argc, "resize", EXPECTED_AT_LEAST, 2))) { - return error; - } // TODO: resize grow|shrink left|right|up|down |