summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-04-10 11:16:23 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-04-10 11:17:42 +0800
commite07bd59ad5f4ba9cd113f8dfdcc72e6ca2e69819 (patch)
tree6d950e5e7b10ef418150e2996d9043504fb11e1d /ui
parenta83a614d94b09d063d56bf28be6f9dd0d0e22854 (diff)
downloadpetitboot-e07bd59ad5f4ba9cd113f8dfdcc72e6ca2e69819.zip
petitboot-e07bd59ad5f4ba9cd113f8dfdcc72e6ca2e69819.tar.gz
ui/ncurses: Don't use menu offsets for user item numbers
The menu offsets are arbitrary, use a separate numbering scheme for user items. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/ncurses/nc-cui.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c
index fce1752..e8aaf9a 100644
--- a/ui/ncurses/nc-cui.c
+++ b/ui/ncurses/nc-cui.c
@@ -161,6 +161,7 @@ static void cui_boot_editor_on_exit(struct cui *cui,
{
struct pmenu *menu = cui->main;
struct cui_opt_data *cod;
+ static int user_idx = 0;
/* Was the edit cancelled? */
if (!bd) {
@@ -184,7 +185,7 @@ static void cui_boot_editor_on_exit(struct cui *cui,
item->on_execute = cui_boot;
item->data = cod = talloc_zero(item, struct cui_opt_data);
- cod->name = talloc_asprintf(cod, "User item %u:", insert_pt);
+ cod->name = talloc_asprintf(cod, "User item %u:", ++user_idx);
if (pmenu_item_setup(menu, item, insert_pt,
talloc_strdup(item, cod->name)) == NULL) {
talloc_free(item);
OpenPOWER on IntegriCloud