mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-07 19:05:07 -05:00
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:
@@ -943,6 +943,7 @@ get_date (const char *p, const time_t *now)
|
||||
tm.tm_hour += yyRelHour;
|
||||
tm.tm_min += yyRelMinutes;
|
||||
tm.tm_sec += yyRelSeconds;
|
||||
tm.tm_wday = 0;
|
||||
|
||||
/* Let mktime deduce tm_isdst if we have an absolute timestamp,
|
||||
or if the relative timestamp mentions days, months, or years. */
|
||||
|
||||
Reference in New Issue
Block a user