diff --git a/esphome/components/debug/debug_esp8266.cpp b/esphome/components/debug/debug_esp8266.cpp index 337c6a307c7..8b36fa46de5 100644 --- a/esphome/components/debug/debug_esp8266.cpp +++ b/esphome/components/debug/debug_esp8266.cpp @@ -10,10 +10,9 @@ static const char *const TAG = "debug"; const char *DebugComponent::get_reset_reason_(std::span buffer) { char *buf = buffer.data(); - const size_t size = RESET_REASON_BUFFER_SIZE; #if !defined(CLANG_TIDY) String reason = ESP.getResetReason(); // NOLINT - snprintf(buf, size, "%s", reason.c_str()); + snprintf(buf, RESET_REASON_BUFFER_SIZE, "%s", reason.c_str()); return buf; #else buf[0] = '\0';