OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
ASSERT (OptionsOpCodeHandle != NULL);\r
\r
- for (Index = 0; Index < 4; Index++) {\r
+ for (Index = 0; Index < sizeof (TerminalType) / sizeof (TerminalType[0]); Index++) {\r
CheckFlags = 0;\r
if (NewTerminalContext->TerminalType == Index) {\r
CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r