From b8af8a06bc96705487bcfeef3aa6aa54da9aa825 Mon Sep 17 00:00:00 2001 From: Bert Melis Date: Mon, 13 Jan 2025 11:21:06 +0100 Subject: [PATCH] fixes --- src/Datapoint/ConversionHelpers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Datapoint/ConversionHelpers.cpp b/src/Datapoint/ConversionHelpers.cpp index bf70080..930a2c9 100644 --- a/src/Datapoint/ConversionHelpers.cpp +++ b/src/Datapoint/ConversionHelpers.cpp @@ -92,15 +92,16 @@ std::size_t decodeSchedule(const uint8_t* data, std::size_t len, char* output, s unsigned int minutes = (data[i] & 0x07) * 10; if (hour > 23 || minutes > 59) { hour = 0; - minutes 0; + minutes = 0; } - std::size_t result = snprintf(&output[pos], maxLen - result, "%u.02:%u.02", hour, minutes); + int result = snprintf(&output[pos], maxLen - result, "%u.02:%u.02", hour, minutes); if (result < 0) return 0; pos += result; if (i < 7) { - &output[pos++] = ' '; + output[pos++] = ' '; } } + return pos; } } // end namespace VitoWiFi