Clean up tag_count config parsing; defensively clamp tag snprintf

This commit is contained in:
Gerry Hernandez 2026-03-09 19:13:01 -07:00
parent 8cc5579e16
commit 139f25a0b9
3 changed files with 4 additions and 3 deletions

View file

@ -1577,6 +1577,7 @@ bool parse_option(Config *config, char *key, char *value) {
config->default_nmaster = atoi(value);
} else if (strcmp(key, "tag_count") == 0) {
config->tag_count = CLAMP_INT(atoi(value), 1, 32);
tag_count = config->tag_count;
} else if (strcmp(key, "center_master_overspread") == 0) {
config->center_master_overspread = atoi(value);
} else if (strcmp(key, "center_when_single_stack") == 0) {
@ -3494,6 +3495,7 @@ bool parse_config(void) {
config.scroller_proportion_preset_count = 0;
config.circle_layout = NULL;
config.circle_layout_count = 0;
config.tag_count = 9;
config.tag_rules = NULL;
config.tag_rules_count = 0;
config.cursor_theme = NULL;