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 4582ffb21b..8db973ca79 100644 --- a/components/log/host_test/log_test/main/log_test.cpp +++ b/components/log/host_test/log_test/main/log_test.cpp @@ -95,7 +95,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; }