From df1b0ae60f7c738113a1bf7fdbaacdf8c292d361 Mon Sep 17 00:00:00 2001 From: LuChiChick <1084116302@qq.com> Date: Tue, 14 Oct 2025 15:20:50 +0800 Subject: [PATCH] Bug fix for segmentation fault caused by multi format definition command --- Src/Main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Src/Main.cpp b/Src/Main.cpp index 2e78185..1e99204 100644 --- a/Src/Main.cpp +++ b/Src/Main.cpp @@ -94,9 +94,11 @@ int main(int argc, char *argv[]) // 添加到类型列表中 { + // 静态列表指针,支持多段格式串输入 + static format_list_node *target_format_node = nullptr; + char *p_param = argv[count + 1]; int param_len = strlen(argv[count + 1]); - format_list_node *target_format_node = nullptr; while (p_param - argv[count + 1] < param_len) { // 分配空间