prevent crash when `layout auto` is missing args

master
Zandr Martin 8 years ago
parent 34fae764a5
commit f65a88e68d
No known key found for this signature in database
GPG Key ID: AA2BB8EF77F7BBDC

@ -85,6 +85,10 @@ static struct cmd_results *cmd_layout_auto(swayc_t *container, int argc, char **
enum swayc_layouts old_layout = container->layout;
enum swayc_layouts layout = old_layout;
if ((error = checkarg(argc, "layout auto", EXPECTED_MORE_THAN, 1))) {
return error;
}
if (strcasecmp(argv[1], "left") == 0) {
layout = L_AUTO_LEFT;
} else if (strcasecmp(argv[1], "right") == 0) {

Loading…
Cancel
Save