Skip to content

Commit

Permalink
(__tzfile_compute): For use_last case set i to num_transition rather …
Browse files Browse the repository at this point in the history
…than num_transitions - 1.
  • Loading branch information
Ulrich Drepper committed Oct 16, 2007
1 parent 8d137b6 commit e2cceb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions time/tzfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ __tzfile_compute (time_t timer, int use_localtime,
if (tzspec == NULL)
{
use_last:
i = num_transitions - 1;
i = num_transitions;
goto found;
}

Expand Down Expand Up @@ -666,7 +666,8 @@ __tzfile_compute (time_t timer, int use_localtime,
i = hi;

found:
/* assert (timer >= transitions[i - 1] && timer < transitions[i]); */
/* assert (timer >= transitions[i - 1]
&& (i == num_transitions || timer < transitions[i])); */
__tzname[types[type_idxs[i - 1]].isdst]
= __tzstring (&zone_names[types[type_idxs[i - 1]].idx]);
size_t j = i;
Expand Down

0 comments on commit e2cceb5

Please sign in to comment.