1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-11 15:52:20 +01:00

fix calculation

This commit is contained in:
J. Nick Koston
2025-07-07 15:01:15 -05:00
parent c1a6e82322
commit 73b786c22e

View File

@@ -121,8 +121,8 @@ void Logger::log_vprintf_(uint8_t level, const char *tag, int line, const __Flas
if (this->baud_rate_ > 0) { if (this->baud_rate_ > 0) {
this->write_msg_(this->tx_buffer_ + msg_start); this->write_msg_(this->tx_buffer_ + msg_start);
} }
size_t msg_length = this->tx_buffer_at_ - 1; // -1 to exclude null terminator 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_length); this->log_callback_.call(level, tag, this->tx_buffer_ + msg_start, msg_length);
global_recursion_guard_ = false; global_recursion_guard_ = false;
} }