]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Corrected search in steps list
authorc vw <dl1ycf@darc.de>
Fri, 21 May 2021 18:01:11 +0000 (20:01 +0200)
committerc vw <dl1ycf@darc.de>
Fri, 21 May 2021 18:01:11 +0000 (20:01 +0200)
step_menu.c

index 64d46506a92076dc0213fa386c69fc388e7404a6..8804d01eaae8c886bb3ad7732331dffaf1782b88 100644 (file)
@@ -86,8 +86,7 @@ void step_menu(GtkWidget *parent) {
   gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
 
   GtkWidget *step_rb=NULL;
-  int i=0;
-  while(steps[i]!=0) {
+  for (int i=0; i<STEPS; i++) {
     if(i==0) {
       step_rb=gtk_radio_button_new_with_label(NULL,step_labels[i]);
     } else {
@@ -98,7 +97,6 @@ void step_menu(GtkWidget *parent) {
     gtk_widget_show(step_rb);
     gtk_grid_attach(GTK_GRID(grid),step_rb,i%5,1+(i/5),1,1);
     g_signal_connect(step_rb,"toggled",G_CALLBACK(step_select_cb),(gpointer)(long)i);
-    i++;
   }
 
   gtk_container_add(GTK_CONTAINER(content),grid);