Commit 606e0c19 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

kernel32: Fix GetCurrencyFormatA when input length is 0.

Fixes a regression introduced by 42afb693. Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com>
parent c55f8f35
...@@ -481,8 +481,6 @@ int WINAPI GetCurrencyFormatA( LCID lcid, DWORD flags, const char *value, ...@@ -481,8 +481,6 @@ int WINAPI GetCurrencyFormatA( LCID lcid, DWORD flags, const char *value,
} }
MultiByteToWideChar( cp, 0, value, -1, input, ARRAY_SIZE(input) ); MultiByteToWideChar( cp, 0, value, -1, input, ARRAY_SIZE(input) );
if (len > (int)ARRAY_SIZE(output)) len = ARRAY_SIZE(output);
if (format) if (format)
{ {
CURRENCYFMTW fmt; CURRENCYFMTW fmt;
...@@ -509,9 +507,9 @@ int WINAPI GetCurrencyFormatA( LCID lcid, DWORD flags, const char *value, ...@@ -509,9 +507,9 @@ int WINAPI GetCurrencyFormatA( LCID lcid, DWORD flags, const char *value,
fmt.lpDecimalSep = fmt_decimal; fmt.lpDecimalSep = fmt_decimal;
fmt.lpThousandSep = fmt_thousand; fmt.lpThousandSep = fmt_thousand;
fmt.lpCurrencySymbol = fmt_symbol; 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 ); if (ret) ret = WideCharToMultiByte( cp, 0, output, -1, buffer, len, 0, 0 );
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment