Преглед изворни кода

* fixed range errors

git-svn-id: trunk@5315 -
Jonas Maebe пре 18 година
родитељ
комит
eb411035eb
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      rtl/unix/timezone.inc

+ 3 - 3
rtl/unix/timezone.inc

@@ -154,7 +154,7 @@ var
   
   function readbufbyte: byte;
   begin
-    if bufptr >= @buf[bufsize] then
+    if bufptr > @buf[bufsize-1] then
       readfilebuf;
     readbufbyte := bufptr^;
     inc(bufptr);
@@ -166,7 +166,7 @@ var
   begin
     readbuf := 0;
     repeat
-      numbytes := @buf[bufsize] - bufptr;
+      numbytes := @buf[bufsize-1] - bufptr + 1;
       if numbytes > count then
         numbytes := count;
       if numbytes > 0 then
@@ -203,7 +203,7 @@ begin
   f:=fpopen(fn,Open_RdOnly);
   if f<0 then
    exit;
-  bufptr := @buf[bufsize];
+  bufptr := @buf[bufsize-1]+1;
   i:=readbuf(tzhead,sizeof(tzhead));
   if i<>sizeof(tzhead) then
    exit;