[ros-diffs] [cfinck] 36946: Return if the screensaver window couldn't be created to avoid a warning about using the uninitialized variable "msg". Spotted by KJK & CL

cfinck at svn.reactos.org cfinck at svn.reactos.org
Sat Oct 25 17:14:10 CEST 2008


Author: cfinck
Date: Sat Oct 25 10:14:09 2008
New Revision: 36946

URL: http://svn.reactos.org/svn/reactos?rev=36946&view=rev
Log:
Return if the screensaver window couldn't be created to avoid a warning about using the uninitialized variable "msg".
Spotted by KJK & CL

Modified:
    trunk/reactos/lib/sdk/scrnsave/scrnsave.c

Modified: trunk/reactos/lib/sdk/scrnsave/scrnsave.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/scrnsave/scrnsave.c?rev=36946&r1=36945&r2=36946&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/scrnsave/scrnsave.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/scrnsave/scrnsave.c [iso-8859-1] Sat Oct 25 10:14:09 2008
@@ -185,15 +185,15 @@
                                  0, 0, rc.right, rc.bottom, hParent, NULL,
                                  hMainInstance, NULL);
 
+    if(!hMainWindow)
+        return 1;
+
     // Display window and start pumping messages
-    if (hMainWindow)
-    {
-        ShowWindow(hMainWindow, SW_SHOW);
-        SetCursor(NULL);
-
-        while (GetMessage(&msg, NULL, 0, 0))
-            DispatchMessage(&msg);
-    }
+    ShowWindow(hMainWindow, SW_SHOW);
+    SetCursor(NULL);
+
+    while (GetMessage(&msg, NULL, 0, 0))
+        DispatchMessage(&msg);
 
     return msg.wParam;
 }



More information about the Ros-diffs mailing list