From 9e13f6ac4c2922156f5b351db52e8ccdf5db441d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 25 Dec 2025 20:46:20 -1000 Subject: [PATCH] copilot is wrong, add comment --- esphome/components/wifi_info/wifi_info_text_sensor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/wifi_info/wifi_info_text_sensor.cpp b/esphome/components/wifi_info/wifi_info_text_sensor.cpp index 1860ace9495..eae0f87b403 100644 --- a/esphome/components/wifi_info/wifi_info_text_sensor.cpp +++ b/esphome/components/wifi_info/wifi_info_text_sensor.cpp @@ -46,8 +46,8 @@ void DNSAddressWifiInfo::dump_config() { LOG_TEXT_SENSOR("", "DNS Address", this void DNSAddressWifiInfo::on_ip_state(const network::IPAddresses &ips, const network::IPAddress &dns1, const network::IPAddress &dns2) { - // Single buffer: IP1 + space + IP2 + null - char buf[network::IP_ADDRESS_BUFFER_SIZE * 2 + 1]; + // IP_ADDRESS_BUFFER_SIZE (40) = max IP (39) + null; space reuses first null's slot + char buf[network::IP_ADDRESS_BUFFER_SIZE * 2]; dns1.str_to(buf); size_t len1 = strlen(buf); buf[len1] = ' ';