From 8358ef00960e7b6e75ef050333df84b603650f95 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 16 Dec 2025 23:06:31 +0000 Subject: [PATCH] Use ESPHOME_strncpy_P in get_build_time_string() Replace platform-specific ifdef with cross-platform ESPHOME_strncpy_P macro for consistency. --- esphome/core/application.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 9a4c0fce05..4c9cc6b2b6 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -1,6 +1,7 @@ #include "esphome/core/application.h" #include "esphome/core/build_info_data.h" #include "esphome/core/log.h" +#include "esphome/core/progmem.h" #include #ifdef USE_ESP8266 @@ -720,11 +721,7 @@ void Application::wake_loop_threadsafe() { #endif // defined(USE_SOCKET_SELECT_SUPPORT) && defined(USE_WAKE_LOOP_THREADSAFE) void Application::get_build_time_string(std::span buffer) { -#ifdef USE_ESP8266 - strncpy_P(buffer.data(), ESPHOME_BUILD_TIME_STR, buffer.size()); -#else - strncpy(buffer.data(), ESPHOME_BUILD_TIME_STR, buffer.size()); -#endif + ESPHOME_strncpy_P(buffer.data(), ESPHOME_BUILD_TIME_STR, buffer.size()); buffer[buffer.size() - 1] = '\0'; }