瀏覽代碼

* fix for #31255

git-svn-id: trunk@35327 -
marco 9 年之前
父節點
當前提交
e02949920b
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/rtl-objpas/src/inc/strutils.pp

+ 2 - 2
packages/rtl-objpas/src/inc/strutils.pp

@@ -819,7 +819,7 @@ Var
 
 begin
   FindMatchesBoyerMooreCaseSensitive(PChar(S),Pchar(OldPattern),Length(S),Length(OldPattern),aMatches,aMatchAll);
-  For I:=0 to Length(AMatches) do
+  For I:=0 to pred(Length(AMatches)) do
     Inc(AMatches[i]);
 end;
 
@@ -830,7 +830,7 @@ Var
 
 begin
   FindMatchesBoyerMooreCaseInSensitive(PChar(S),Pchar(OldPattern),Length(S),Length(OldPattern),aMatches,aMatchAll);
-  For I:=0 to Length(AMatches) do
+  For I:=0 to pred(Length(AMatches)) do
     Inc(AMatches[i]);
 end;