]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
don't use uninitialized values in newtWinMenu
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 19 Mar 2008 16:36:01 +0000 (17:36 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 21 Mar 2008 11:58:40 +0000 (12:58 +0100)
windows.c

index 533504d0a1b5e824bfca23584244aa3799e3f4f0..df4e852358ffe6ae159d3ac6e4485a381037ee5a 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -187,7 +187,8 @@ int newtWinMenu(char * title, char * text, int suggestedWidth, int flexDown,
 
     *listItem = ((long) newtListboxGetCurrent(listbox));
 
-    for (rc = 0; result != buttons[rc] && rc < numButtons; rc++);
+    for (rc = 0; rc < numButtons && result != buttons[rc]; rc++)
+       ;
     if (rc == numButtons) 
        rc = 0; /* F12 or return-on-exit (which are the same for us) */
     else