diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-11-17 19:35:49 +1100 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-11-22 10:45:54 +0800 |
commit | 2af53a5c31a1b0c64bdfd4d115b42238a52c3af1 (patch) | |
tree | e5941c7d5ef2a99580b4ed672e4a2cff4dd9d5d6 /ui/ncurses/nc-widgets.c | |
parent | f92de1b28bdee6b9480241b80856532e354cba6a (diff) | |
download | talos-petitboot-2af53a5c31a1b0c64bdfd4d115b42238a52c3af1.tar.gz talos-petitboot-2af53a5c31a1b0c64bdfd4d115b42238a52c3af1.zip |
ui/ncurses/widgets: Add n_options check to widget_select_get_value
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-widgets.c')
-rw-r--r-- | ui/ncurses/nc-widgets.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/ncurses/nc-widgets.c b/ui/ncurses/nc-widgets.c index 98ea6be..d96480e 100644 --- a/ui/ncurses/nc-widgets.c +++ b/ui/ncurses/nc-widgets.c @@ -493,6 +493,8 @@ void widget_select_add_option(struct nc_widget_select *select, int value, int widget_select_get_value(struct nc_widget_select *select) { + if (!select->n_options) + return -1; return select->options[select->selected_option].val; } |