[NOTEPAD] Fix array index use before limits check. By Kudratov Olimjon using Cppcheck...
[reactos.git] / reactos / base / applications / notepad / dialog.c
index 82250ee..08de728 100644 (file)
@@ -1075,7 +1075,7 @@ VOID DIALOG_GoTo(VOID)
     SendMessage(Globals.hEdit, EM_GETSEL, (WPARAM) &dwStart, (LPARAM) &dwEnd);
 
     nLine = 1;
-    for (i = 0; pszText[i] && (i < (int) dwStart); i++)
+    for (i = 0; (i < (int) dwStart) && pszText[i]; i++)
     {
         if (pszText[i] == '\n')
             nLine++;