summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorrtthread-bot <[email protected]>2021-10-15 08:20:37 +0000
committerrtthread-bot <[email protected]>2021-10-15 08:20:37 +0000
commita702763dbc169754102c238ab8ee29dc71f967ee (patch)
tree792f0ff7abd1187fe01177ffc248c3f34a552da0 /components
parenta14aee98e12983c217799c709fea1ff53be127c9 (diff)
parent4907b44930a7b870d1474f89ef13419ca4b2bda4 (diff)
Merge remote-tracking branch 'rtt_gitee/gitee_master'
Diffstat (limited to 'components')
-rw-r--r--components/utilities/ulog/ulog.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/utilities/ulog/ulog.c b/components/utilities/ulog/ulog.c
index eab3c3a936..cd7a418c3b 100644
--- a/components/utilities/ulog/ulog.c
+++ b/components/utilities/ulog/ulog.c
@@ -447,6 +447,7 @@ void ulog_output_to_all_backend(rt_uint32_t level, const char *tag, rt_bool_t is
{
/* recalculate the log start address and log size when backend not supported color */
rt_size_t color_info_len = 0, output_size = size;
+ char *output_log = log;
if (color_output_info[level] != RT_NULL)
color_info_len = rt_strlen(color_output_info[level]);
@@ -455,10 +456,10 @@ void ulog_output_to_all_backend(rt_uint32_t level, const char *tag, rt_bool_t is
{
rt_size_t color_hdr_len = rt_strlen(CSI_START) + color_info_len;
- log += color_hdr_len;
+ output_log += color_hdr_len;
output_size -= (color_hdr_len + (sizeof(CSI_END) - 1));
}
- backend->output(backend, level, tag, is_raw, log, output_size);
+ backend->output(backend, level, tag, is_raw, output_log, output_size);
}
#endif /* !defined(ULOG_USING_COLOR) || defined(ULOG_USING_SYSLOG) */
}