hedgewars/uUtils.pas
changeset 10117 f6aa60d8a336
parent 10116 dd27562b6f21
child 10124 aabd1b75d5a3
--- a/hedgewars/uUtils.pas	Thu Feb 06 22:03:53 2014 +0100
+++ b/hedgewars/uUtils.pas	Thu Feb 06 22:13:30 2014 +0100
@@ -377,7 +377,7 @@
 {$ENDIF}
     exit;
 
-l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), length(s))-1;
+l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), min(length(tmpstr), length(s)))-1;
 i:= 0;
 
 while i < l do