March 9, 2015
4:08 p.m.
In time2sub() there is this code: } else { lo = 1; for (i = 0; i < (int) TYPE_BIT(time_t) - 1; ++i) lo *= 2; hi = -(lo + 1); } The last *= 2 will overflow a signed integer time_t. This can be fixed with “lo = -1” instead of “lo = 1”. This change seems to be consistent with the variable names. - Jörg
March 2015
4:41 p.m.
On 03/09/2015 09:08 AM, Richter, Jörg wrote:
The last *= 2 will overflow a signed integer time_t. This can be fixed with “lo = -1” instead of “lo = 1”.
Thanks for reporting that bug. Attached is a proposed patch that should solve the problem in a simpler way. (It also fixes some nearby white space problems.) I've installed this in the experimental version on github.
4095
Age (days ago)
4096
Last active (days ago)
1 comments
2 participants
participants (2)
-
Paul Eggert -
Richter, Jörg