utils: 添加 p_strdup_nullable 辅助函数

This commit is contained in:
2026-03-23 09:55:47 +08:00
parent 577c5bc3b2
commit 38572bd5f7
3 changed files with 11 additions and 6 deletions

View File

@@ -93,7 +93,7 @@ wm_layout_id_t wm_layout_register(wm_layout_registry_t *registry,
r->id = id;
r->name = p_strdup(name);
r->symbol = p_strdup(symbol);
r->description = description ? p_strdup(description) : nullptr;
r->description = p_strdup_nullable(description);
r->fn = fn;
registry->slot_count++;