codehelp: dont try to access string at positions > it length (0010887)

git-svn-id: trunk@14296 -
This commit is contained in:
paul 2008-02-28 07:13:22 +00:00
parent f181308801
commit 59f40cb1af

View File

@ -512,7 +512,7 @@ begin
or (CompareIdentifiers(@Result[StartPos+1],'p')=0) then
begin
// add new line
if not (Result[EndPos] in [#10,#13]) then
if (EndPos <= Length(Result)) and not (Result[EndPos] in [#10,#13]) then
Result:=copy(Result,1,EndPos-1)+LineEnding+copy(Result,EndPos,length(Result));
end;
StartPos:=EndPos;