Module: wine Branch: master Commit: 606e0c191ed8fc26544c04f236c560b2f5e3e835 URL: https://gitlab.winehq.org/wine/wine/-/commit/606e0c191ed8fc26544c04f236c560b...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Wed Mar 8 20:31:29 2023 +0200
kernel32: Fix GetCurrencyFormatA when input length is 0.
Fixes a regression introduced by 42afb693b10dee9a06fcadb204560490a24f1754.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/kernel32/locale.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 3783cf6505f..235034f6117 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -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;