From dc49f4c1805f5881d0c96dac13733db68f636af9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 9 Jan 2026 16:19:43 -1000 Subject: [PATCH] fix --- esphome/components/prometheus/prometheus_handler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/prometheus/prometheus_handler.cpp b/esphome/components/prometheus/prometheus_handler.cpp index 4f23f18942..aeadd60140 100644 --- a/esphome/components/prometheus/prometheus_handler.cpp +++ b/esphome/components/prometheus/prometheus_handler.cpp @@ -370,7 +370,8 @@ void PrometheusHandler::light_row_(AsyncResponseStream *stream, light::LightStat if (effect == "None") { stream->print(ESPHOME_F("None\"} 0\n")); } else { - stream->write(effect.c_str(), effect.size()); + // c_str() is safe as effect names are null-terminated strings from codegen + stream->print(effect.c_str()); stream->print(ESPHOME_F("\"} 1\n")); } }