allow minutes only for clock input

This commit is contained in:
MichaelDvP
2024-09-18 09:28:16 +02:00
parent 3fa18e2984
commit aca2ae88cc

View File

@@ -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
}