Merge pull request #1510 from mkbel/fix_menu_stack_third_time
Fix menu stack overrun.
This commit is contained in:
commit
3cbcbba738
@ -122,7 +122,7 @@ void menu_back_if_clicked_fb(void)
|
||||
|
||||
void menu_submenu(menu_func_t submenu)
|
||||
{
|
||||
if (menu_depth <= MENU_DEPTH_MAX)
|
||||
if (menu_depth < MENU_DEPTH_MAX)
|
||||
{
|
||||
menu_stack[menu_depth].menu = menu_menu;
|
||||
menu_stack[menu_depth++].position = lcd_encoder;
|
||||
@ -132,7 +132,7 @@ void menu_submenu(menu_func_t submenu)
|
||||
|
||||
static void menu_submenu_no_reset(menu_func_t submenu)
|
||||
{
|
||||
if (menu_depth <= MENU_DEPTH_MAX)
|
||||
if (menu_depth < MENU_DEPTH_MAX)
|
||||
{
|
||||
menu_stack[menu_depth].menu = menu_menu;
|
||||
menu_stack[menu_depth++].position = lcd_encoder;
|
||||
|
Loading…
Reference in New Issue
Block a user