[MAGNIFY] Fix a string buffer misuage that led to division by zero exception. (#1655)
[reactos.git] / base / applications / magnify / magnifier.c
index f8d63cf..13a0a3c 100644 (file)
@@ -16,6 +16,7 @@
 #include <winuser.h>
 #include <wingdi.h>
 #include <winnls.h>
+#include <commctrl.h>
 #include <shellapi.h>
 #include <windowsx.h>
 #include <stdlib.h>
@@ -77,6 +78,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
 {
     MSG msg;
     HACCEL hAccelTable;
+    INITCOMMONCONTROLSEX iccex;
 
     UNREFERENCED_PARAMETER(hPrevInstance);
     UNREFERENCED_PARAMETER(lpCmdLine);
@@ -111,6 +113,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
         }
     }
 
+    /* Load the common controls */
+    iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+    iccex.dwICC = ICC_STANDARD_CLASSES | ICC_WIN95_CLASSES;
+    InitCommonControlsEx(&iccex);
 
     SelectObject(hdcOffscreen, hbmpOld);
     DeleteObject (hbmpOffscreen);
@@ -925,7 +931,7 @@ INT_PTR CALLBACK OptionsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
                 if (HIWORD(wParam) == CBN_SELCHANGE)
                 {
                     HWND hCombo = GetDlgItem(hDlg,IDC_ZOOM);
-                    LPCTSTR currentZoomValue = TEXT("");
+                    TCHAR currentZoomValue[2] = TEXT("");
 
                     /* Get index of current selection and the text of that selection */
                     int currentSelectionIndex = ComboBox_GetCurSel(hCombo);