mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
allow minutes only for clock input
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user