From ffa79a4b4ece6d02fd25b940e2b2bbd444052777 Mon Sep 17 00:00:00 2001 From: wen13245 Date: Fri, 21 Apr 2023 18:44:06 +0800 Subject: [PATCH] Modifies the argument of the sizeof statement to a legitimate array name --- components/app_trace/sys_view/ext/logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/app_trace/sys_view/ext/logging.c b/components/app_trace/sys_view/ext/logging.c index 4735c84d18..d6b7ee80d1 100644 --- a/components/app_trace/sys_view/ext/logging.c +++ b/components/app_trace/sys_view/ext/logging.c @@ -18,7 +18,7 @@ int esp_sysview_vprintf(const char * format, va_list args) portENTER_CRITICAL(&s_log_mutex); size_t len = vsnprintf(log_buffer, sizeof(log_buffer), format, args); if (len > sizeof(log_buffer) - 1) { - log_buffer[sizeof(log_buffer - 1)] = 0; + log_buffer[sizeof(log_buffer) - 1] = 0; } SEGGER_SYSVIEW_Print(log_buffer); portEXIT_CRITICAL(&s_log_mutex);