<div dir="ltr">Hi Paul,<div><a href="https://github.com/eggert/tz/commit/8b238ec54c09556eb2aa405c1741eedfd12c4a87#diff-a001603e7d3e105c7c6d83ce1e92e6ed69e835e9698e39d78d338a9eb2cc1cfe">https://github.com/eggert/tz/commit/8b238ec54c09556eb2aa405c1741eedfd12c4a87#diff-a001603e7d3e105c7c6d83ce1e92e6ed69e835e9698e39d78d338a9eb2cc1cfe</a> added validation of tm argument.</div><div>I wonder why localtime_r call is done:</div><div>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)?</div><div><div>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? </div></div><div><br></div><div>Thanks,</div><div>Almaz</div></div>