From 73b786c22e3e5f99a0af4959272d80332e91ad05 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 7 Jul 2025 15:01:15 -0500 Subject: [PATCH] fix calculation --- esphome/components/logger/logger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/logger/logger.cpp b/esphome/components/logger/logger.cpp index a7d6852c43..41aa2313b6 100644 --- a/esphome/components/logger/logger.cpp +++ b/esphome/components/logger/logger.cpp @@ -121,8 +121,8 @@ void Logger::log_vprintf_(uint8_t level, const char *tag, int line, const __Flas if (this->baud_rate_ > 0) { this->write_msg_(this->tx_buffer_ + msg_start); } - size_t msg_length = this->tx_buffer_at_ - 1; // -1 to exclude null terminator - this->log_callback_.call(level, tag, this->tx_buffer_, msg_length); + size_t msg_length = this->tx_buffer_at_ - msg_start - 1; // -1 to exclude null terminator + this->log_callback_.call(level, tag, this->tx_buffer_ + msg_start, msg_length); global_recursion_guard_ = false; }