From 4564e0b828301067bb47d07930356f565708405d Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 23 Mar 2025 10:06:49 +0100 Subject: [PATCH] fix printable chars in lastcode --- src/devices/boiler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 5f528888e..56421036e 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -1848,10 +1848,11 @@ void Boiler::process_UBAErrorMessage(std::shared_ptr telegram) { uint32_t date = (year - 2000) * 535680UL + month * 44640UL + day * 1440UL + hour * 60 + min + duration; // check valid https://github.com/emsesp/EMS-ESP32/issues/2189 if (day == 0 || day > 31 || month == 0 || month > 12 || !std::isprint(code[0]) || !std::isprint(code[1])) { - if (!lastCodeDate_) { + if (!lastCodeDate_ && std::isprint(code[0]) && std::isprint(code[1])) { char newCode[sizeof(lastCode_)]; snprintf(newCode, sizeof(lastCode_), "%s(%d)", code, codeNo); has_update(lastCode_, newCode, sizeof(lastCode_)); + lastCodeDate_ = 1; } return; }