Browse Source

* Correct StuffString for character size in unicodestring

Michaël Van Canneyt 1 year ago
parent
commit
76909f0894
1 changed files with 3 additions and 3 deletions
  1. 3 3
      packages/rtl-objpas/src/inc/strutils.pp

+ 3 - 3
packages/rtl-objpas/src/inc/strutils.pp

@@ -1131,9 +1131,9 @@ begin
   if ALength> k then
   if ALength> k then
     ALength:=k;
     ALength:=k;
   SetLength(Result,i+j-ALength);
   SetLength(Result,i+j-ALength);
-  move (AText[1],result[1],AStart-1);
-  move (ASubText[1],result[AStart],j);
-  move (AText[AStart+ALength], Result[AStart+j],i+1-AStart-ALength);
+  move (AText[1],result[1],AStart-1*SizeOf(Char));
+  move (ASubText[1],result[AStart],j*SizeOf(Char));
+  move (AText[AStart+ALength], Result[AStart+j],(i+1-AStart-ALength)*SizeOf(Char));
 end;
 end;
 
 
 function RandomFrom(const AValues: array of string): string;
 function RandomFrom(const AValues: array of string): string;