From d5d007cdb1a12b4bf2194ded06bf175936b7bc8f Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 26 Jul 2025 18:07:29 +0800 Subject: [PATCH] fix: crash when not set layoutname in tagrule --- src/config/parse_config.h | 1 + src/maomao.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 8e0880b..19c98e7 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -2495,6 +2495,7 @@ void reload_config(const Arg *arg) { !rule_monitor_name) { for (jk = 0; jk < LENGTH(layouts); jk++) { if (config.tag_rules_count > 0 && + config.tag_rules[i - 1].layout_name && strcmp(layouts[jk].name, config.tag_rules[i - 1].layout_name) == 0) { m->pertag->ltidxs[config.tag_rules[i - 1].id] = diff --git a/src/maomao.c b/src/maomao.c index d779cc4..157362f 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -2438,6 +2438,7 @@ void createmon(struct wl_listener *listener, void *data) { for (i = 1; i <= config.tag_rules_count; i++) { for (jk = 0; jk < LENGTH(layouts); jk++) { if (config.tag_rules_count > 0 && + config.tag_rules[i - 1].layout_name && strcmp(layouts[jk].name, config.tag_rules[i - 1].layout_name) == 0) { m->pertag->ltidxs[config.tag_rules[i - 1].id] = &layouts[jk];