diff options
| author | Sherman <[email protected]> | 2021-11-04 13:59:22 +0800 |
|---|---|---|
| committer | Sherman <[email protected]> | 2021-11-04 13:59:22 +0800 |
| commit | 6e004d4b12993a1206c6ff0168bd602bd71e9e9b (patch) | |
| tree | 4ad5048005defe9d48c3969e875066a3ec8a9ec0 /components/utilities | |
| parent | 85934d95e6ac046ed81fc763769c60c48a42c4cb (diff) | |
| parent | 3f3418d173e5a5d3a5b9cea27da1987491bf9e6a (diff) | |
Merge branch 'master' of github.com:RT-Thread/rt-thread
Diffstat (limited to 'components/utilities')
| -rw-r--r-- | components/utilities/ulog/ulog.c | 5 |
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) */ } |
