From 0b676c0daa4bc17dd8c683a9da5956f3fd42be5a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 14 Jan 2026 16:02:42 -1000 Subject: [PATCH] review --- esphome/components/cse7766/cse7766.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/cse7766/cse7766.cpp b/esphome/components/cse7766/cse7766.cpp index f0d1f91398..6a61e726b9 100644 --- a/esphome/components/cse7766/cse7766.cpp +++ b/esphome/components/cse7766/cse7766.cpp @@ -227,9 +227,9 @@ void CSE7766Component::parse_data_() { #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERY_VERBOSE { - // Buffer: 7 + 14 + 31 + 14 + 24 = 90 chars max + null, rounded to 96. - // Float sizes assume typical sensor values (voltage ~220V, current <10A, power <3000W). - char buf[96]; + // Buffer: 7 + 15 + 33 + 15 + 25 = 95 chars max + null, rounded to 128 for safety margin. + // Float sizes with %.4f can be up to 11 chars for large values (e.g., 999999.9999). + char buf[128]; size_t pos = buf_append_(buf, sizeof(buf), 0, "Parsed:"); if (have_voltage) { pos = buf_append_(buf, sizeof(buf), pos, " V=%.4fV", voltage);