]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
don't crash when running empty form
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 9 Jul 2008 17:50:25 +0000 (19:50 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 9 Jul 2008 17:50:25 +0000 (19:50 +0200)
form.c

diff --git a/form.c b/form.c
index fefa5c0a9f07fd8776f0bfa41456d1950679998a..c82ffd7746bbe978c575faeac3aaa552b045cfed 100644 (file)
--- a/form.c
+++ b/form.c
@@ -932,7 +932,8 @@ void newtFormRun(newtComponent co, struct newtExitStruct * es) {
     newtDrawForm(co);
 
     if (form->currComp == -1) {
-       gotoComponent(form, 0);
+       if (form->numComps)
+           gotoComponent(form, 0);
     } else
        gotoComponent(form, form->currComp);