SynEdit: fix range check error from revision 19001 #a26d1805de

git-svn-id: trunk@19002 -
This commit is contained in:
martin 2009-03-15 17:59:35 +00:00
parent a26d1805de
commit d92087e835

View File

@ -978,8 +978,9 @@ procedure TSynEditUndoGroup.Insert(AIndex: Integer; AnItem: TSynEditUndoItem);
begin
if FCount >= FCapacity then
Grow;
System.Move(FItems[AIndex], FItems[AIndex+1],
(FCount - AIndex) * SizeOf(TSynEditUndoItem));
If AIndex < FCount then
System.Move(FItems[AIndex], FItems[AIndex+1],
(FCount - AIndex) * SizeOf(TSynEditUndoItem));
FItems[AIndex] := AnItem;
inc (FCount);
end;