Nikolay Sivov : comctl32/datetime: Fix use of out-of-scope local buffer ( Coverity).

Alexandre Julliard julliard at winehq.org
Fri Feb 25 11:19:45 CST 2011


Module: wine
Branch: master
Commit: f8ba490e589a99a7e71fee6dd299e50e4dd40f3e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f8ba490e589a99a7e71fee6dd299e50e4dd40f3e

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Feb 25 11:38:28 2011 +0300

comctl32/datetime: Fix use of out-of-scope local buffer (Coverity).

---

 dlls/comctl32/datetime.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index 1ac6ba7..ed625e9 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -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;
 }
 
 




More information about the wine-cvs mailing list