time-util: mktime_or_timegm are changing the struct tm
after that wm_day etc. seems to be changed. Moving the check infront of the mktime_or_timegm fixes that.
This commit is contained in:
@@ -849,11 +849,11 @@ parse_usec:
|
||||
}
|
||||
|
||||
from_tm:
|
||||
x = mktime_or_timegm(&tm, utc);
|
||||
if (x < 0)
|
||||
if (weekday >= 0 && tm.tm_wday != weekday)
|
||||
return -EINVAL;
|
||||
|
||||
if (weekday >= 0 && tm.tm_wday != weekday)
|
||||
x = mktime_or_timegm(&tm, utc);
|
||||
if (x < 0)
|
||||
return -EINVAL;
|
||||
|
||||
ret = (usec_t) x * USEC_PER_SEC + x_usec;
|
||||
|
||||
Reference in New Issue
Block a user