RE: bug introduced in tzcode2005c
The infinite loop is caused by my failure to check for overflow; here's a proposed fix. --ado ------- localtime.c ------- *** /tmp/geta2299 Tue Aug 9 09:56:30 2005 --- /tmp/getb2299 Tue Aug 9 09:56:30 2005 *************** *** 5,11 **** #ifndef lint #ifndef NOID ! static char elsieid[] = "@(#)localtime.c 7.95"; #endif /* !defined NOID */ #endif /* !defined lint */ --- 5,11 ---- #ifndef lint #ifndef NOID ! static char elsieid[] = "@(#)localtime.c 7.96"; #endif /* !defined NOID */ #endif /* !defined lint */ *************** *** 1616,1624 **** --- 1616,1628 ---- if (dir != 0) { if (t == lo) { ++t; + if (t <= lo) + return WRONG; ++lo; } else if (t == hi) { --t; + if (t >= hi) + return WRONG; --hi; } if (lo > hi)
participants (1)
-
Olson, Arthur David (NIH/NCI)