Commit b19c9848 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

shlwapi: Add size parameters to function that takes array arguments.

parent bc0f9c49
...@@ -66,7 +66,8 @@ static HRESULT WINAPI _SHStrDupAA(LPCSTR,LPSTR*); ...@@ -66,7 +66,8 @@ static HRESULT WINAPI _SHStrDupAA(LPCSTR,LPSTR*);
static HRESULT WINAPI _SHStrDupAW(LPCWSTR,LPSTR*); static HRESULT WINAPI _SHStrDupAW(LPCWSTR,LPSTR*);
static void FillNumberFmt(NUMBERFMTW *fmt, WCHAR decimal_buffer[8], WCHAR thousand_buffer[8]) static void FillNumberFmt(NUMBERFMTW *fmt, LPWSTR decimal_buffer, int decimal_bufwlen,
LPWSTR thousand_buffer, int thousand_bufwlen)
{ {
WCHAR grouping[64]; WCHAR grouping[64];
WCHAR *c; WCHAR *c;
...@@ -74,8 +75,8 @@ static void FillNumberFmt(NUMBERFMTW *fmt, WCHAR decimal_buffer[8], WCHAR thousa ...@@ -74,8 +75,8 @@ static void FillNumberFmt(NUMBERFMTW *fmt, WCHAR decimal_buffer[8], WCHAR thousa
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_ILZERO|LOCALE_RETURN_NUMBER, (LPWSTR)&fmt->LeadingZero, sizeof(fmt->LeadingZero)/sizeof(WCHAR)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_ILZERO|LOCALE_RETURN_NUMBER, (LPWSTR)&fmt->LeadingZero, sizeof(fmt->LeadingZero)/sizeof(WCHAR));
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_INEGNUMBER|LOCALE_RETURN_NUMBER, (LPWSTR)&fmt->LeadingZero, sizeof(fmt->NegativeOrder)/sizeof(WCHAR)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_INEGNUMBER|LOCALE_RETURN_NUMBER, (LPWSTR)&fmt->LeadingZero, sizeof(fmt->NegativeOrder)/sizeof(WCHAR));
fmt->NumDigits = 0; fmt->NumDigits = 0;
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal_buffer, sizeof(decimal_buffer)/sizeof(WCHAR)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal_buffer, decimal_bufwlen);
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousand_buffer, sizeof(thousand_buffer)/sizeof(WCHAR)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousand_buffer, thousand_bufwlen);
fmt->lpThousandSep = thousand_buffer; fmt->lpThousandSep = thousand_buffer;
fmt->lpDecimalSep = decimal_buffer; fmt->lpDecimalSep = decimal_buffer;
...@@ -114,7 +115,8 @@ static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf) ...@@ -114,7 +115,8 @@ static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf)
WCHAR *c; WCHAR *c;
BOOL neg = (qdwValue < 0); BOOL neg = (qdwValue < 0);
FillNumberFmt(&fmt, decimal, thousand); FillNumberFmt(&fmt, decimal, sizeof decimal / sizeof (WCHAR),
thousand, sizeof thousand / sizeof (WCHAR));
c = &buf[24]; c = &buf[24];
*(--c) = 0; *(--c) = 0;
...@@ -147,7 +149,8 @@ static int FormatDouble(double value, int decimals, LPWSTR pszBuf, int cchBuf) ...@@ -147,7 +149,8 @@ static int FormatDouble(double value, int decimals, LPWSTR pszBuf, int cchBuf)
snprintfW(buf, 64, flfmt, value); snprintfW(buf, 64, flfmt, value);
FillNumberFmt(&fmt, decimal, thousand); FillNumberFmt(&fmt, decimal, sizeof decimal / sizeof (WCHAR),
thousand, sizeof thousand / sizeof (WCHAR));
fmt.NumDigits = decimals; fmt.NumDigits = decimals;
return GetNumberFormatW(LOCALE_USER_DEFAULT, 0, buf, &fmt, pszBuf, cchBuf); return GetNumberFormatW(LOCALE_USER_DEFAULT, 0, buf, &fmt, pszBuf, cchBuf);
} }
......
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