diff --git a/reactos/boot/freeldr/freeldr/options.c b/reactos/boot/freeldr/freeldr/options.c index adeb8b45b9d..b2c3a570f30 100644 --- a/reactos/boot/freeldr/freeldr/options.c +++ b/reactos/boot/freeldr/freeldr/options.c @@ -26,7 +26,7 @@ PCSTR OptionsMenuList[] = "Safe Mode with Networking", "Safe Mode with Command Prompt", - "SEPARATOR", + NULL, "Enable Boot Logging", "Enable VGA Mode", @@ -35,7 +35,7 @@ PCSTR OptionsMenuList[] = "Debugging Mode", "FreeLdr debugging", - "SEPARATOR", + NULL, #ifdef HAS_OPTION_MENU_CUSTOM_BOOT "Custom Boot", diff --git a/reactos/boot/freeldr/freeldr/ui/directui.c b/reactos/boot/freeldr/freeldr/ui/directui.c index 371cc67afd5..ca1b949809e 100644 --- a/reactos/boot/freeldr/freeldr/ui/directui.c +++ b/reactos/boot/freeldr/freeldr/ui/directui.c @@ -297,7 +297,7 @@ UiDrawMenuBox(IN PUI_MENU_INFO MenuInfo) for (i = 0; i < MenuInfo->MenuItemCount; i++) { /* Check if it's a separator */ - if (!(_stricmp(MenuInfo->MenuItemList[i], "SEPARATOR"))) + if (MenuInfo->MenuItemList[i] == NULL) { /* Draw the separator line */ UiDrawText(MenuInfo->Left, @@ -325,10 +325,11 @@ UiDrawMenuItem(IN PUI_MENU_INFO MenuInfo, strcat(MenuLineText, " "); /* Now append the text string */ - strcat(MenuLineText, MenuInfo->MenuItemList[MenuItemNumber]); + if (MenuInfo->MenuItemList[MenuItemNumber]) + strcat(MenuLineText, MenuInfo->MenuItemList[MenuItemNumber]); /* If it is a separator */ - if (!(_stricmp(MenuInfo->MenuItemList[MenuItemNumber], "SEPARATOR"))) + if (MenuInfo->MenuItemList[MenuItemNumber] == NULL) { /* Make it a separator line and use menu colors */ memset(MenuLineText, 0, 80); @@ -436,7 +437,7 @@ UiProcessMenuKeyboardEvent(IN PUI_MENU_INFO MenuInfo, /* Skip past any separators */ if ((Selected) && - !(_stricmp(MenuInfo->MenuItemList[Selected], "SEPARATOR"))) + (MenuInfo->MenuItemList[Selected] == NULL)) { MenuInfo->SelectedMenuItem--; } @@ -450,7 +451,7 @@ UiProcessMenuKeyboardEvent(IN PUI_MENU_INFO MenuInfo, /* Skip past any separators */ if ((Selected < Count) && - !(_stricmp(MenuInfo->MenuItemList[Selected], "SEPARATOR"))) + (MenuInfo->MenuItemList[Selected] == NULL)) { MenuInfo->SelectedMenuItem++; } @@ -479,8 +480,11 @@ UiCalcMenuBoxSize(IN PUI_MENU_INFO MenuInfo) for (i = 0; i < MenuInfo->MenuItemCount; i++) { /* Get the string length and make it become the new width if necessary */ - Length = strlen(MenuInfo->MenuItemList[i]); - if (Length > Width) Width = Length; + if (MenuInfo->MenuItemList[i]) + { + Length = (ULONG)strlen(MenuInfo->MenuItemList[i]); + if (Length > Width) Width = Length; + } } /* Allow room for left & right borders, plus 8 spaces on each side */ diff --git a/reactos/boot/freeldr/freeldr/ui/tuimenu.c b/reactos/boot/freeldr/freeldr/ui/tuimenu.c index 4ccd13b780e..0eb4c35185e 100644 --- a/reactos/boot/freeldr/freeldr/ui/tuimenu.c +++ b/reactos/boot/freeldr/freeldr/ui/tuimenu.c @@ -157,8 +157,11 @@ TuiCalcMenuBoxSize(PUI_MENU_INFO MenuInfo) // // Get the string length and make it become the new width if necessary // - Length = (ULONG)strlen(MenuInfo->MenuItemList[i]); - if (Length > Width) Width = Length; + if (MenuInfo->MenuItemList[i]) + { + Length = (ULONG)strlen(MenuInfo->MenuItemList[i]); + if (Length > Width) Width = Length; + } } // @@ -334,7 +337,7 @@ TuiDrawMenuBox(PUI_MENU_INFO MenuInfo) // // Check if it's a separator // - if (!(_stricmp(MenuInfo->MenuItemList[i], "SEPARATOR"))) + if (MenuInfo->MenuItemList[i] == NULL) { // // Draw the separator line @@ -373,7 +376,8 @@ TuiDrawMenuItem(PUI_MENU_INFO MenuInfo, // how many spaces will be to the left and right // SpaceTotal = (MenuInfo->Right - MenuInfo->Left - 2) - - (ULONG)strlen(MenuInfo->MenuItemList[MenuItemNumber]); + (ULONG)(MenuInfo->MenuItemList[MenuItemNumber] ? + strlen(MenuInfo->MenuItemList[MenuItemNumber]) : 0); SpaceLeft = (SpaceTotal / 2) + 1; SpaceRight = (SpaceTotal - SpaceLeft) + 1; @@ -395,7 +399,8 @@ TuiDrawMenuItem(PUI_MENU_INFO MenuInfo, // // Now append the text string // - strcat(MenuLineText, MenuInfo->MenuItemList[MenuItemNumber]); + if (MenuInfo->MenuItemList[MenuItemNumber]) + strcat(MenuLineText, MenuInfo->MenuItemList[MenuItemNumber]); // // Check if using centered menu, and add spaces on the right if so @@ -405,7 +410,7 @@ TuiDrawMenuItem(PUI_MENU_INFO MenuInfo, // // If it is a separator // - if (!(_stricmp(MenuInfo->MenuItemList[MenuItemNumber], "SEPARATOR"))) + if (MenuInfo->MenuItemList[MenuItemNumber] == NULL) { // // Make it a separator line and use menu colors @@ -504,7 +509,7 @@ TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo, // Skip past any separators if ((Selected) && - !(_stricmp(MenuInfo->MenuItemList[Selected], "SEPARATOR"))) + (MenuInfo->MenuItemList[Selected] == NULL)) { MenuInfo->SelectedMenuItem--; } @@ -520,7 +525,7 @@ TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo, // Skip past any separators if ((Selected < Count) && - !(_stricmp(MenuInfo->MenuItemList[Selected], "SEPARATOR"))) + (MenuInfo->MenuItemList[Selected] == NULL)) { MenuInfo->SelectedMenuItem++; }