diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-04-10 11:16:23 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-04-10 11:17:42 +0800 |
commit | e07bd59ad5f4ba9cd113f8dfdcc72e6ca2e69819 (patch) | |
tree | 6d950e5e7b10ef418150e2996d9043504fb11e1d /ui | |
parent | a83a614d94b09d063d56bf28be6f9dd0d0e22854 (diff) | |
download | petitboot-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.c | 3 |
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); |