🐛 Fix DOGM time overflow, alignment (#25103)
This commit is contained in:
committed by
Scott Lahteine
parent
471330b56e
commit
569bbb18d0
@ -151,7 +151,9 @@ struct duration_t {
|
||||
* 123456789 (strlen)
|
||||
* 12'34
|
||||
* 99:59
|
||||
* 11d 12:33
|
||||
* 123:45
|
||||
* 1d 12:33
|
||||
* 9999d 12:33
|
||||
*/
|
||||
uint8_t toDigital(char *buffer, bool with_days=false) const {
|
||||
const uint16_t h = uint16_t(this->hour()),
|
||||
@ -159,7 +161,7 @@ struct duration_t {
|
||||
if (with_days) {
|
||||
const uint16_t d = this->day();
|
||||
sprintf_P(buffer, PSTR("%hud %02hu:%02hu"), d, h % 24, m); // 1d 23:45
|
||||
return d >= 10 ? 9 : 8;
|
||||
return strlen_P(buffer);
|
||||
}
|
||||
else if (!h) {
|
||||
const uint16_t s = uint16_t(this->second() % 60UL);
|
||||
|
Reference in New Issue
Block a user