From 2d4b1b9db0d480305e815c718fe78a667c1de633 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Thu, 12 Dec 2002 03:55:45 +0000 Subject: [PATCH] In Get{Currency,Number}FormatA, SetLastError to ERROR_INSUFFICIENT_BUFFER if the buffer is too small. --- ole/ole2nls.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ole/ole2nls.c b/ole/ole2nls.c index 51de301ff32..d288e58b541 100644 --- a/ole/ole2nls.c +++ b/ole/ole2nls.c @@ -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; }