From 35801d795a91623e122b8a445888ab7f60851206 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 11 Mar 2026 12:39:55 -1000 Subject: [PATCH] Fix missed rename: reason[0] -> REASON[0] in sizeof expressions Co-Authored-By: J. Nick Koston --- esphome/components/esp32/crash_handler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/esp32/crash_handler.cpp b/esphome/components/esp32/crash_handler.cpp index 5b8e1a6c970..1aa4f651423 100644 --- a/esphome/components/esp32/crash_handler.cpp +++ b/esphome/components/esp32/crash_handler.cpp @@ -161,7 +161,7 @@ static const char *get_exception_reason() { "StoreProhibited", }; uint32_t cause = s_raw_crash_data.cause; - if (cause < sizeof(REASON) / sizeof(reason[0]) && REASON[cause] != nullptr) + if (cause < sizeof(REASON) / sizeof(REASON[0]) && REASON[cause] != nullptr) return REASON[cause]; #elif CONFIG_IDF_TARGET_ARCH_RISCV // For SoC-level panics (watchdog, cache error), mcause holds IDF-internal @@ -188,7 +188,7 @@ static const char *get_exception_reason() { "Store page fault", }; uint32_t cause = s_raw_crash_data.cause; - if (cause < sizeof(REASON) / sizeof(reason[0]) && REASON[cause] != nullptr) + if (cause < sizeof(REASON) / sizeof(REASON[0]) && REASON[cause] != nullptr) return REASON[cause]; #endif return "Unknown";