Browse Source

--- Merging r15328 into '.':
U rtl/win/sysutils.pp

# revisions: 15328
------------------------------------------------------------------------
r15328 | marco | 2010-05-26 22:14:08 +0200 (Wed, 26 May 2010) | 4 lines
Changed paths:
M /trunk/rtl/win/sysutils.pp

* fix for Mantis 16564. Raise buffersize of getlocalechar to MSDN limit 4,
so that locales with long dateseparators (time,thousand,decimal) now
succeed, even if limited only to first char. (Delphi limit)

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@15523 -

marco 15 years ago
parent
commit
646a07595b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      rtl/win/sysutils.pp

+ 2 - 2
rtl/win/sysutils.pp

@@ -630,9 +630,9 @@ end;
 
 
 function GetLocaleChar(LID, LT: Longint; Def: Char): Char;
 function GetLocaleChar(LID, LT: Longint; Def: Char): Char;
 var
 var
-  Buf: array[0..1] of Char;
+  Buf: array[0..3] of Char; // sdate allows 4 chars.
 begin
 begin
-  if GetLocaleInfo(LID, LT, Buf, 2) > 0 then
+  if GetLocaleInfo(LID, LT, Buf, sizeof(buf)) > 0 then
     Result := Buf[0]
     Result := Buf[0]
   else
   else
     Result := Def;
     Result := Def;