[tz] Invalid tm handling in %s pattern in strftime

Almaz Mingaleev mingaleev at google.com
Mon Jun 6 17:35:27 UTC 2022

Hi Paul,
validation of tm argument.
I wonder why localtime_r call is done:
1) According to the man page mktime sets errno if tm is invalid. Why is it
not safe to just check errno value (saving and restoring it if needed)?
2) man page says that in error case mktime "returns (time_t) -1 and does
not alter the members of the broken-down time structure". Wouldn't it be
enough to check that tm.tm_yday is >= 0?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mm.icann.org/pipermail/tz/attachments/20220606/5d033d12/attachment.html>

More information about the tz mailing list