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 }