mirror of
https://github.com/reactos/wine.git
synced 2025-02-22 22:01:51 +00:00
comctl32/datetime: Fix use of out-of-scope local buffer (Coverity).
This commit is contained in:
parent
101c8ca5ac
commit
f8ba490e58
@ -277,10 +277,11 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, LPCWSTR formattxt)
|
||||
|
||||
|
||||
static BOOL
|
||||
DATETIME_SetFormatW (DATETIME_INFO *infoPtr, LPCWSTR lpszFormat)
|
||||
DATETIME_SetFormatW (DATETIME_INFO *infoPtr, LPCWSTR format)
|
||||
{
|
||||
if (!lpszFormat) {
|
||||
WCHAR format_buf[80];
|
||||
WCHAR format_buf[80];
|
||||
|
||||
if (!format) {
|
||||
DWORD format_item;
|
||||
|
||||
if (infoPtr->dwStyle & DTS_LONGDATEFORMAT)
|
||||
@ -290,13 +291,13 @@ DATETIME_SetFormatW (DATETIME_INFO *infoPtr, LPCWSTR lpszFormat)
|
||||
else /* DTS_SHORTDATEFORMAT */
|
||||
format_item = LOCALE_SSHORTDATE;
|
||||
GetLocaleInfoW(LOCALE_USER_DEFAULT, format_item, format_buf, sizeof(format_buf)/sizeof(format_buf[0]));
|
||||
lpszFormat = format_buf;
|
||||
format = format_buf;
|
||||
}
|
||||
|
||||
DATETIME_UseFormat (infoPtr, lpszFormat);
|
||||
DATETIME_UseFormat (infoPtr, format);
|
||||
InvalidateRect (infoPtr->hwndSelf, NULL, TRUE);
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user