Fix bug to make.Reason is goto

This commit is contained in:
guoheng authored and 曾奥然 committed 2026-03-20 11:10:40 +08:00
1 parent 6152c7f18c
commit bf75ccb77c
1 file changed
+4 -2
+4 -2
View File
@@ -473,6 +473,8 @@ static char *
_xy_str_to_terminal_style (int style, const char *str)
{
char *color_fmt_str = NULL;
size_t len;
char *buf;
if (!xy.enable_color)
{
@@ -511,8 +513,8 @@ _xy_str_to_terminal_style (int style, const char *str)
new_str:
// -2 把中间%s减掉
size_t len = strlen (color_fmt_str) - 2;
char *buf = malloc (strlen (str) + len + 1);
len = strlen (color_fmt_str) - 2;
buf = malloc (strlen (str) + len + 1);
sprintf (buf, color_fmt_str, str);
return buf;
}