Skip to content

Commit

Permalink
fix segfault
Browse files Browse the repository at this point in the history
Signed-off-by: Holger Levsen <holger@layer-acht.org>
  • Loading branch information
matlacki authored and h01ger committed Nov 14, 2023
1 parent 7584f8c commit 139fd92
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/t4k_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,13 +1032,15 @@ int T4K_RunMenu(int index, bool return_choice, void (*draw_background)(), int (*
}

/* Announce the item again when page is scrolled or mouse hover*/
if (menu->submenu[loc + menu->first_entry]->desc == NULL)
T4K_Tts_say(DEFAULT_VALUE,DEFAULT_VALUE,INTERRUPT,"%s",
_(menu->submenu[loc + menu->first_entry]->title));
else
T4K_Tts_say(DEFAULT_VALUE,DEFAULT_VALUE,INTERRUPT,"%s. %s",
_(menu->submenu[loc + menu->first_entry]->title),_(menu->submenu[loc + menu->first_entry]->desc));

if(loc >= 0 && loc < items)
{
if (menu->submenu[loc + menu->first_entry]->desc == NULL)
T4K_Tts_say(DEFAULT_VALUE,DEFAULT_VALUE,INTERRUPT,"%s",
_(menu->submenu[loc + menu->first_entry]->title));
else
T4K_Tts_say(DEFAULT_VALUE,DEFAULT_VALUE,INTERRUPT,"%s. %s",
_(menu->submenu[loc + menu->first_entry]->title),_(menu->submenu[loc + menu->first_entry]->desc));
}
/* whole menu will be redrawn so there is no need to draw anything now */
break;
}
Expand Down

0 comments on commit 139fd92

Please sign in to comment.