sys/vtimer: initialize all values in get_localtime
This commit is contained in:
parent
0b3b0c770a
commit
b7c23c8e5b
@ -308,11 +308,10 @@ void vtimer_get_localtime(struct tm *localt)
|
|||||||
timex_t now;
|
timex_t now;
|
||||||
vtimer_now(&now);
|
vtimer_now(&now);
|
||||||
|
|
||||||
|
memset(localt, 0, sizeof(struct tm));
|
||||||
localt->tm_sec = now.seconds % 60;
|
localt->tm_sec = now.seconds % 60;
|
||||||
localt->tm_min = (now.seconds / 60) % 60;
|
localt->tm_min = (now.seconds / 60) % 60;
|
||||||
localt->tm_hour = (now.seconds / 60 / 60) % 24;
|
localt->tm_hour = (now.seconds / 60 / 60) % 24;
|
||||||
|
|
||||||
// TODO: fill the other fields
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void vtimer_init(void)
|
void vtimer_init(void)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user