]> granicus.if.org Git - php/commitdiff
omg. take #2 to fix the bug. sorry..
authorNuno Lopes <nlopess@php.net>
Fri, 1 Sep 2006 23:25:29 +0000 (23:25 +0000)
committerNuno Lopes <nlopess@php.net>
Fri, 1 Sep 2006 23:25:29 +0000 (23:25 +0000)
ext/date/lib/parse_tz.c

index c5a8ed7099c9491d4233361e903c0d3d16dd686d..bf7cd808612e806b580073e722209b328fdc9c0d 100644 (file)
@@ -196,7 +196,7 @@ static int tz_search(char *timezone, int left, int right, const timelib_tzdb *tz
 {
        int mid, cmp;
 
-       if (left >= right) {
+       if (left > right) {
                return -1; /* not found */
        }
  
@@ -217,7 +217,7 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
 {
        int     pos;
        
-       pos = tz_search(timezone, 0, tzdb->index_size, tzdb);
+       pos = tz_search(timezone, 0, tzdb->index_size - 1, tzdb);
 
        if (pos == -1) {
                return 0;