From: John Darrington Date: Sat, 30 Jul 2016 14:09:18 +0000 (+0200) Subject: Fix possible crash if no buttons are active (should never be the case) X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ede2c036dd0520562bbeb31e02dfdc938403921;p=pspp Fix possible crash if no buttons are active (should never be the case) Found by cppcheck --- diff --git a/src/ui/gui/psppire-val-chooser.c b/src/ui/gui/psppire-val-chooser.c index 25a34f1275..2ff3f188c7 100644 --- a/src/ui/gui/psppire-val-chooser.c +++ b/src/ui/gui/psppire-val-chooser.c @@ -612,11 +612,10 @@ psppire_val_chooser_get_status (PsppireValChooser *vr, struct old_value *ov) { if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (vr->rw[i].rb))) { + range_opt[i].set (vr, ov, &vr->rw[i]); break; } } - - range_opt[i].set (vr, ov, &vr->rw[i]); } /* This might need to be changed to something less naive.