浏览代码

* Small correction in POS (prevent moving out of buffer if offset<>1)

git-svn-id: trunk@33057 -
michael 10 年之前
父节点
当前提交
e2733c9a50
共有 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);
+     MaxLen:=Length(source)-Length(SubStr)-(OffSet-1);
      i:=Offset-1;
      pc:=@source[Offset];
      while (i<=MaxLen) do