mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-02 14:41:18 +08:00
Fix the bug of wrong length in xy_log()
This commit is contained in:
parent
f1df0ffb06
commit
22553fe751
2
chsrc.c
2
chsrc.c
|
@ -609,7 +609,7 @@ call_cmd (void* cmdptr, const char* arg)
|
|||
void
|
||||
print_available_mirrors ()
|
||||
{
|
||||
xy_info ("chsrc: 可用以下镜像站,所有的致谢属于这些站点以及它们的开发/维护者们");
|
||||
xy_info ("chsrc: 支持以下镜像站,荣耀与感恩均归于这些站点,以及它们的开发/维护者们");
|
||||
for (int i=0; i<xy_arylen(available_mirrors); i++)
|
||||
{
|
||||
mirror_info* mir = available_mirrors[i];
|
||||
|
|
4
helper.h
4
helper.h
|
@ -81,8 +81,8 @@ xy_log (int level, const char* str)
|
|||
//xy_assert ("CAN'T REACH!");
|
||||
}
|
||||
|
||||
// -2 把中间%s减掉,-1 把末尾nul减掉
|
||||
size_t len = sizeof(color_fmt_str) -2 -1;
|
||||
// -2 把中间%s减掉
|
||||
size_t len = strlen(color_fmt_str) -2;
|
||||
char* buf = malloc(strlen(str) + len + 1);
|
||||
|
||||
sprintf (buf, color_fmt_str, str);
|
||||
|
|
Loading…
Reference in New Issue
Block a user