rtc+getdate: initialize tm_wday for mktime()

Even though mktime() is documented as ignoring the tm_wday field, the
coverity static analyzer complains about passing an uninitialized value.
Set the field to zero to make it happy.
This commit is contained in:
Miroslav Lichvar
2024-03-04 11:34:22 +01:00
parent ad79aec946
commit b0750136b5
2 changed files with 2 additions and 0 deletions

View File

@@ -802,6 +802,7 @@ read_from_device(int fd_, int event, void *any)
rtc_tm.tm_mday = rtc_raw.tm_mday;
rtc_tm.tm_mon = rtc_raw.tm_mon;
rtc_tm.tm_year = rtc_raw.tm_year;
rtc_tm.tm_wday = 0;
rtc_t = t_from_rtc(&rtc_tm);