projects
/
petitboot
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f92de1b
)
ui/ncurses/widgets: Add n_options check to widget_select_get_value
author
Jeremy Kerr
<jk@ozlabs.org>
Sun, 17 Nov 2013 08:35:49 +0000
(19:35 +1100)
committer
Jeremy Kerr
<jk@ozlabs.org>
Fri, 22 Nov 2013 02:45:54 +0000
(10:45 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
ui/ncurses/nc-widgets.c
patch
|
blob
|
history
diff --git
a/ui/ncurses/nc-widgets.c
b/ui/ncurses/nc-widgets.c
index 98ea6be269774bf8186f7baedc1b597d0aa079be..d96480e960ab4d54e876a75655f2909777c1e0cd 100644
(file)
--- 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;
}