[MAGNIFY] Fix a string buffer misuage that led to division by zero exception. (#1655) 1655/head
authorBișoc George <fraizeraust99@gmail.com>
Fri, 14 Jun 2019 18:52:41 +0000 (20:52 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 15 Jun 2019 16:12:54 +0000 (18:12 +0200)
The iZoom variable was wrongly initialized to zero because the _ttoi()
called failed due to the fact the temporary string buffer was too small.

base/applications/magnify/magnifier.c

index cfca251..13a0a3c 100644 (file)
@@ -931,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);