oleaut32: Correctly get the Currency separator in VarFormatCurrency.

LOCALE_SCURRENCY allows for 13 chracters including the NULL.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46442
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 29cf8ee8ab)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
Alistair Leslie-Hughes 2019-02-24 07:00:32 +00:00 committed by Michael Stefaniuc
parent 449e0c5c0a
commit 31b05fdc72
1 changed files with 2 additions and 2 deletions

View File

@ -2443,7 +2443,7 @@ HRESULT WINAPI VarFormatCurrency(LPVARIANT pVarIn, INT nDigits, INT nLeading,
if (SUCCEEDED(hRet))
{
WCHAR buff[256], decimal[8], thousands[8], currency[8];
WCHAR buff[256], decimal[8], thousands[8], currency[13];
CURRENCYFMTW numfmt;
if (nDigits < 0)
@ -2484,7 +2484,7 @@ HRESULT WINAPI VarFormatCurrency(LPVARIANT pVarIn, INT nDigits, INT nLeading,
numfmt.lpThousandSep = thousands;
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, thousands, ARRAY_SIZE(thousands));
numfmt.lpCurrencySymbol = currency;
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, currency, ARRAY_SIZE(currency));
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SCURRENCY, currency, ARRAY_SIZE(currency));
/* use NLS as per VarFormatNumber() */
if (GetCurrencyFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt, buff, ARRAY_SIZE(buff)))