Browse Source

* Merge request !710

Michaël Van Canneyt 1 year ago
parent
commit
193f20b697
1 changed files with 2 additions and 3 deletions
  1. 2 3
      rtl/objpas/sysutils/sysformt.inc

+ 2 - 3
rtl/objpas/sysutils/sysformt.inc

@@ -368,9 +368,8 @@ begin
                     hs:=Args[doarg].VVariant^;
                     hs:=Args[doarg].VVariant^;
                 Index:=Length(hs);
                 Index:=Length(hs);
                 If (Prec<>-1) and (Index>Prec) then
                 If (Prec<>-1) and (Index>Prec) then
-                  ToAdd:=Copy(hs,1,Prec)
-                else
-                  ToAdd:=hs;
+                  SetLength(hs,Prec);
+                ToAdd:=hs;
               end;
               end;
         'P' : Begin
         'P' : Begin
               CheckArg(vtpointer,true);
               CheckArg(vtpointer,true);