# HG changeset patch # User sheepluva # Date 1425780246 -3600 # Node ID 287634baf7ba5689e835919cdfd91abb6733f852 # Parent 9e5763cb805e3f8d11bcd12ea1c68eae077c5d87 and ofc fix pas2c build diff -r 9e5763cb805e -r 287634baf7ba hedgewars/uChat.pas --- a/hedgewars/uChat.pas Sun Mar 08 02:40:32 2015 +0100 +++ b/hedgewars/uChat.pas Sun Mar 08 03:04:06 2015 +0100 @@ -708,11 +708,12 @@ end; // TODO: honor utf8, don't break utf8 chars when shifting chars beyond limit -procedure InsertIntoInputStr(var s: shortstring); +procedure InsertIntoInputStr(s: shortstring); var i, l, il, lastc: integer; begin // safe length for string l:= min(MaxInputStrLen-cursorPos, Length(s)); + s:= copy(s,1,l); // if we insert rather than append, shift info in InputStrL accordingly if cursorPos < Length(InputStr.s) then @@ -732,7 +733,7 @@ InputStrL[cursorPos + l]:= cursorPos; // insert string truncated to safe length - Insert(copy(s,1,l), InputStr.s, cursorPos + 1); + Insert(s, InputStr.s, cursorPos + 1); if Length(InputStr.s) > MaxInputStrLen then InputStr.s[0]:= char(MaxInputStrLen);