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:
parent
becff61e20
commit
fbada0df58
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user