Browse Source

Without a copy in most cases

Alligator-1 1 year ago
parent
commit
f60bed0823
1 changed files with 3 additions and 2 deletions
  1. 3 2
      rtl/objpas/sysutils/sysformt.inc

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

@@ -368,8 +368,9 @@ 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
-                  Index:=Prec;
-                ToAdd:=Copy(hs,1,Index);
+                  ToAdd:=Copy(hs,1,Prec)
+                else
+                  ToAdd:=hs;
               end;
               end;
         'P' : Begin
         'P' : Begin
               CheckArg(vtpointer,true);
               CheckArg(vtpointer,true);