Update esphome/components/mqtt/mqtt_component.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2026-01-14 14:00:57 -10:00
committed by GitHub
co-authored by Copilot
parent 2182d1e9f0
commit d27d6d64da
+1 -1
View File
@@ -232,7 +232,7 @@ bool MQTTComponent::send_discovery_() {
#else
const char *fmt = ver_fmt;
#endif
// sizeof(ver_fmt) + 8: format specifier expands to 8 hex digits, plus safety margin
// Buffer sized for format string expansion: ~4 bytes net growth from format specifier to 8 hex digits, plus safety margin
char version_buf[sizeof(ver_fmt) + 8];
snprintf(version_buf, sizeof(version_buf), fmt, App.get_config_hash());
device_info[MQTT_DEVICE_SW_VERSION] = version_buf;