From aca2ae88cc26bd12384645927f862dbfedf83ed0 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 18 Sep 2024 09:28:16 +0200 Subject: [PATCH] allow minutes only for clock input --- src/helpers.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helpers.cpp b/src/helpers.cpp index 6262b4ea5..bb7d6f775 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -380,7 +380,7 @@ std::string Helpers::data_to_hex(const uint8_t * data, const uint8_t length) { } char str[length * 3]; - memset(str, 0, length * sizeof(char)); + memset(str, 0, sizeof(str)); char buffer[4]; char * p = &str[0]; @@ -837,6 +837,8 @@ uint16_t Helpers::string2minutes(const std::string & str) { if (state == 1 && tmp < 60) { return res + tmp; + } else if (state == 0) { // without : it's only minutes + return tmp; } else { return 0; // Or if we were not, something is wrong in the given string }