소스 검색

Revert r33057. MaxLen is the maximum value that Pos can return and does not need to be adjusted by (Offset - 1). Also there's no buffer that could be overrun as i is not used to access the string's buffer. Fixes failure of tests/test/units/system/tstring.pp

git-svn-id: trunk@33089 -
svenbarth 9 년 전
부모
커밋
77cb13c38c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      rtl/inc/wstrings.inc

+ 1 - 1
rtl/inc/wstrings.inc

@@ -586,7 +586,7 @@ begin
   Pos:=0;
   if (Length(SubStr)>0) and (Offset>0) and (Offset<Length(Source)) then
    begin
-     MaxLen:=Length(source)-Length(SubStr)-(OffSet-1);
+     MaxLen:=Length(source)-Length(SubStr);
      i:=Offset-1;
      pc:=@source[Offset];
      while (i<=MaxLen) do