...
 
Commits (1)
  • Rob Swindell's avatar
    Fix off-by-one error caught by GCC: · 392ec43a
    Rob Swindell authored
    gtkmonitor.c:156:79: warning: iteration 9 invokes undefined behavior [-Waggressive-loop-optimizations]
       sprintf(str,"%-2d  SL: %-2d  F1: %s",i,cfg.val_level[i],ltoaf(cfg.val_flags1[i],flags));
                                                                     ~~~~~~~~~~~~~~^~~
    gtkmonitor.c:151:2: note: within this loop
      for(i=1; i<=10; i++) {
      ^~~
    392ec43a
......@@ -153,7 +153,7 @@ void refresh_events(void)
gtk_list_store_append(quickstore, &curr);
quickslots++;
}
sprintf(str,"%-2d SL: %-2d F1: %s",i,cfg.val_level[i],ltoaf(cfg.val_flags1[i],flags));
sprintf(str,"%-2d SL: %-2d F1: %s",i,cfg.val_level[i - 1],ltoaf(cfg.val_flags1[i - 1],flags));
gtk_list_store_set(quickstore, &curr, 0, str, -1);
gtk_tree_model_iter_next(GTK_TREE_MODEL(quickstore), &curr);
}
......