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

kernel32: Fix GetNumberFormatA when input length is 0.

Fixes a regression introduced by b6bf69ef. Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com>
parent 13afaa7c
...@@ -430,8 +430,6 @@ int WINAPI GetNumberFormatA( LCID lcid, DWORD flags, const char *value, ...@@ -430,8 +430,6 @@ int WINAPI GetNumberFormatA( 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)
{ {
NUMBERFMTW fmt; NUMBERFMTW fmt;
...@@ -455,9 +453,9 @@ int WINAPI GetNumberFormatA( LCID lcid, DWORD flags, const char *value, ...@@ -455,9 +453,9 @@ int WINAPI GetNumberFormatA( LCID lcid, DWORD flags, const char *value,
fmt.NegativeOrder = format->NegativeOrder; fmt.NegativeOrder = format->NegativeOrder;
fmt.lpDecimalSep = fmt_decimal; fmt.lpDecimalSep = fmt_decimal;
fmt.lpThousandSep = fmt_thousand; fmt.lpThousandSep = fmt_thousand;
ret = GetNumberFormatW( lcid, flags, input, &fmt, output, len ); ret = GetNumberFormatW( lcid, flags, input, &fmt, output, ARRAY_SIZE(output) );
} }
else ret = GetNumberFormatW( lcid, flags, input, NULL, output, len ); else ret = GetNumberFormatW( 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