mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 16:09:26 +02:00
* buffer overflow checking in ptccrt.KeyBufAdd
git-svn-id: trunk@16141 -
This commit is contained in:
parent
ba6a4760e9
commit
e7c4990780
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user