Return buffer in duration.toString

This commit is contained in:
Scott Lahteine
2019-09-27 02:59:49 -05:00
parent dc65788511
commit d683f98019
5 changed files with 12 additions and 24 deletions

View File

@ -120,7 +120,7 @@ struct duration_t {
* 59m 59s
* 59s
*/
void toString(char *buffer) const {
char* toString(char * const buffer) const {
int y = this->year(),
d = this->day() % 365,
h = this->hour() % 24,
@ -132,6 +132,7 @@ struct duration_t {
else if (h) sprintf_P(buffer, PSTR("%ih %im %is"), h, m, s);
else if (m) sprintf_P(buffer, PSTR("%im %is"), m, s);
else sprintf_P(buffer, PSTR("%is"), s);
return buffer;
}
/**