diff --git a/components/log/host_test/log_test/main/log_test.cpp b/components/log/host_test/log_test/main/log_test.cpp index a26187a4f7..d80eb68077 100644 --- a/components/log/host_test/log_test/main/log_test.cpp +++ b/components/log/host_test/log_test/main/log_test.cpp @@ -104,7 +104,7 @@ private: int print_to_buffer(const char *format, va_list args) { // Added support for multi-line log, for example ESP_LOG_BUFFER... - int ret = vsnprintf(&print_buffer[buffer_idx], BUFFER_SIZE, format, args); + int ret = vsnprintf(&print_buffer[buffer_idx], BUFFER_SIZE - buffer_idx, format, args); buffer_idx += ret; return ret; }