提交 43b1daf3 编写于 作者: C chenyong

[utilities][ulog] fix ulog backend color log length calculation error

Signed-off-by: Nchenyong <chenyong@rt-thread.com>
上级 87b5f3f5
......@@ -408,7 +408,11 @@ void ulog_output_to_all_backend(rt_uint32_t level, const char *tag, rt_bool_t is
else
{
/* recalculate the log start address and log size when backend not supported color */
rt_size_t color_info_len = rt_strlen(color_output_info[level]), output_size = size;
rt_size_t color_info_len = 0, output_size = size;
if (color_output_info[level] != RT_NULL)
color_info_len = rt_strlen(color_output_info[level]);
if (color_info_len)
{
rt_size_t color_hdr_len = rt_strlen(CSI_START) + color_info_len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册