1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-30 08:51:19 +01:00

periph_common/rtc: handle m_mday == 0 in rtc_tm_normalize()

This commit is contained in:
Benjamin Valentin 2020-02-04 16:10:31 +01:00 committed by Benjamin Valentin
parent becff61e20
commit fbada0df58

View File

@ -138,6 +138,10 @@ void rtc_tm_normalize(struct tm *t)
{
div_t d;
if (t->tm_mday == 0) {
t->tm_mday = 1;
}
d = div(t->tm_sec, 60);
t->tm_min += d.quot;
t->tm_sec = d.rem;