* buffer overflow checking in ptccrt.KeyBufAdd

git-svn-id: trunk@16141 -
This commit is contained in:
nickysn 2010-10-12 14:17:35 +00:00
parent ba6a4760e9
commit e7c4990780

View File

@ -79,7 +79,10 @@ end;
procedure KeyBufAdd(Ch: Char);
begin
{todo: overflow checking}
{ do nothing, if the buffer is full }
if ((KeyBufTail + 1) = KeyBufHead) or
((KeyBufTail = High(KeyBuffer)) and (KeyBufHead = Low(KeyBuffer))) then
exit;
KeyBuffer[KeyBufTail] := Ch;
Inc(KeyBufTail);
if KeyBufTail > High(KeyBuffer) then