kernel32: Fix GetCurrencyFormatA when input length is 0.

Fixes a regression introduced by 42afb693b1.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
Gabriel Ivăncescu 2023-03-08 20:31:29 +02:00 committed by Alexandre Julliard
parent c55f8f3518
commit 606e0c191e

View file

@ -481,8 +481,6 @@ int WINAPI GetCurrencyFormatA( LCID lcid, DWORD flags, const char *value,
}
MultiByteToWideChar( cp, 0, value, -1, input, ARRAY_SIZE(input) );
if (len > (int)ARRAY_SIZE(output)) len = ARRAY_SIZE(output);
if (format)
{
CURRENCYFMTW fmt;
@ -509,9 +507,9 @@ int WINAPI GetCurrencyFormatA( LCID lcid, DWORD flags, const char *value,
fmt.lpDecimalSep = fmt_decimal;
fmt.lpThousandSep = fmt_thousand;
fmt.lpCurrencySymbol = fmt_symbol;
ret = GetCurrencyFormatW( lcid, flags, input, &fmt, output, len );
ret = GetCurrencyFormatW( lcid, flags, input, &fmt, output, ARRAY_SIZE(output) );
}
else ret = GetCurrencyFormatW( lcid, flags, input, NULL, output, len );
else ret = GetCurrencyFormatW( lcid, flags, input, NULL, output, ARRAY_SIZE(output) );
if (ret) ret = WideCharToMultiByte( cp, 0, output, -1, buffer, len, 0, 0 );
return ret;