Skip to content
Permalink
Browse files

codegen: fix possible segfault in example

  • Loading branch information...
kodebach committed Sep 3, 2019
1 parent d612e08 commit d1bf6c1b1fa2d90840e109b23a138c04ca34ad69
Showing with 2 additions and 2 deletions.
  1. +2 −2 examples/codegen/menu/src/application.c
@@ -40,7 +40,7 @@ void showMenu (Menu * menu)

char * end;
char buf[20];
int selection;
int selection = -1;
int minSelection = menu->command[0] != '\0' ? 0 : 1;

do
@@ -63,7 +63,7 @@ void showMenu (Menu * menu)
{
system (menu->command);
}
else
else if (selection > 0)
{
showMenu (menu->children[selection - 1]);
}

0 comments on commit d1bf6c1

Please sign in to comment.
You can’t perform that action at this time.