Merge pull request #1906 from emersion/fix-resize-no-arg-segfault

Fix segfault when running the resize command without arguments
This commit is contained in:
Drew DeVault 2018-05-03 09:17:35 -04:00 committed by GitHub
commit 437ae28566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -219,15 +219,17 @@ struct cmd_results *cmd_resize(int argc, char **argv) {
return cmd_results_new(CMD_INVALID, "resize", return cmd_results_new(CMD_INVALID, "resize",
"Can only resize views/containers"); "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) { if (strcasecmp(argv[0], "set") == 0) {
// TODO // TODO
//return cmd_resize_set(argc - 1, &argv[1]); //return cmd_resize_set(argc - 1, &argv[1]);
return cmd_results_new(CMD_INVALID, "resize", "resize set unimplemented"); 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 // TODO: resize grow|shrink left|right|up|down