In Get{Currency,Number}FormatA, SetLastError to

ERROR_INSUFFICIENT_BUFFER if the buffer is too small.
This commit is contained in:
Francois Gouget 2002-12-12 03:55:45 +00:00 committed by Alexandre Julliard
parent 4b97e24380
commit 2d4b1b9db0
1 changed files with 8 additions and 2 deletions

View File

@ -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;
}