We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6152c7f commit bf75ccbCopy full SHA for bf75ccb
1 file changed
lib/xy.h
@@ -473,6 +473,8 @@ static char *
473
_xy_str_to_terminal_style (int style, const char *str)
474
{
475
char *color_fmt_str = NULL;
476
+ size_t len;
477
+ char *buf;
478
479
if (!xy.enable_color)
480
@@ -511,8 +513,8 @@ _xy_str_to_terminal_style (int style, const char *str)
511
513
512
514
new_str:
515
// -2 把中间%s减掉
- size_t len = strlen (color_fmt_str) - 2;
- char *buf = malloc (strlen (str) + len + 1);
516
+ len = strlen (color_fmt_str) - 2;
517
+ buf = malloc (strlen (str) + len + 1);
518
sprintf (buf, color_fmt_str, str);
519
return buf;
520
}
0 commit comments