Commit 2d4b1b9d authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

In Get{Currency,Number}FormatA, SetLastError to

ERROR_INSUFFICIENT_BUFFER if the buffer is too small.
parent 4b97e243
......@@ -2400,7 +2400,10 @@ INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags,
if (cchNumber!=0)
{
memcpy( lpNumberStr, sDestination, min(cchNumber, retVal) );
if (cchNumber < retVal) retVal = 0;
if (cchNumber < retVal) {
retVal = 0;
SetLastError(ERROR_INSUFFICIENT_BUFFER);
}
}
return retVal;
}
......@@ -2653,7 +2656,10 @@ INT WINAPI GetCurrencyFormatA(LCID locale, DWORD dwflags,
if (cchCurrency)
{
memcpy( lpCurrencyStr, pDestination, min(cchCurrency, retVal) );
if (cchCurrency < retVal) retVal = 0;
if (cchCurrency < retVal) {
retVal = 0;
SetLastError(ERROR_INSUFFICIENT_BUFFER);
}
}
return retVal;
}
......
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