Browse Source

* force correct strpas overload when using unicodestrings

Michaël Van Canneyt 1 year ago
parent
commit
48cb0eb5b1
1 changed files with 5 additions and 1 deletions
  1. 5 1
      rtl/objpas/sysutils/dati.inc

+ 5 - 1
rtl/objpas/sysutils/dati.inc

@@ -1294,7 +1294,11 @@ begin
   else
   else
     StoreFormat('C', 0, False);
     StoreFormat('C', 0, False);
   ResultBuffer[ResultLen] := #0;
   ResultBuffer[ResultLen] := #0;
-  result := StrPas(@ResultBuffer);
+  {$IF SIZEOF(CHAR)=1}
+    result := StrPas(PAnsiChar(@ResultBuffer));
+  {$ELSE}
+    result := StrPas(PWideChar(@ResultBuffer));
+  {$ENDIF}
   if (DateTime < 0) and (fdoInterval in Options) then
   if (DateTime < 0) and (fdoInterval in Options) then
     result := '-' + result;
     result := '-' + result;
 end ;
 end ;