Bug fix dynamic menus

Dynamic menus had a buffer_len variable in the parent function but it
was discarded before passing to the callbacks

Why!!?? No clue but everything that used it was assuming MAXPATH
Wouldn't be surprised to see some bugs pop out from this one..

init_menu_lists() was assuming MENU_HAS_DESC and setting the
menu title + icon based on such even though it could be invalid
didn't see anywhere in the code that was currently using MENU_DYNAMIC_DESC
in relation to a top level menu but considering it caused all kinds
of corruption to the menu when I tried its probably been tried
and abandoned before...

Change-Id: I8d961d748918bfa8ea6adb5ad60491af4d739d6e
This commit is contained in:
William Wilgus 2019-09-20 03:07:29 -05:00
parent d0883d747a
commit 10e5e56f3c
6 changed files with 43 additions and 19 deletions

View file

@ -91,7 +91,8 @@ struct menu_item_ex {
const struct menu_get_name_and_icon {
int (*menu_callback)(int action,
const struct menu_item_ex *this_item);
char *(*list_get_name)(int selected_item, void * data, char *buffer);
char *(*list_get_name)(int selected_item, void * data,
char *buffer, size_t buffer_len);
int (*list_speak_item)(int selected_item, void * data);
void *list_get_name_data;
int icon_id;