diff --git a/xtldr2/textui.c b/xtldr2/textui.c index 6a9d6ba..2496027 100644 --- a/xtldr2/textui.c +++ b/xtldr2/textui.c @@ -59,6 +59,13 @@ BlDisplayBootMenu() /* Check if there is anything to show in the boot menu */ if(NumberOfEntries > 0) { + /* Check if all menu entries will fit into the menu box */ + if(NumberOfEntries > Handle.Height - 2) + { + /* Too many menu entries, limit entries to match box height (-2 for upper and bottom borders) */ + NumberOfEntries = Handle.Height - 2; + } + /* Iterate through all menu entries */ for(Index = 0; Index < NumberOfEntries; Index++) {