@return EFI_NOT_FOUND Fail to find boot option variable.\r
**/\r
EFI_STATUS\r
+EFIAPI\r
HotkeyCallback (\r
IN EFI_KEY_DATA *KeyData\r
)\r
HotkeyData = &Hotkey->KeyData[Hotkey->WaitingKey];\r
if ((KeyData->Key.ScanCode == HotkeyData->Key.ScanCode) &&\r
(KeyData->Key.UnicodeChar == HotkeyData->Key.UnicodeChar) &&\r
- ((HotkeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) ? (KeyData->KeyState.KeyShiftState == HotkeyData->KeyState.KeyShiftState) : TRUE)) {\r
+ (((HotkeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) ? (KeyData->KeyState.KeyShiftState == HotkeyData->KeyState.KeyShiftState) : TRUE)) {\r
//\r
// Receive an expecting key stroke\r
//\r
return Status;\r
}\r
Index ++;\r
- } while (Index < Hotkey->CodeCount);\r
+ } while ((Index < Hotkey->CodeCount) && (Index < (sizeof (Hotkey->KeyData) / sizeof (EFI_KEY_DATA))));\r
\r
Link = GetNextNode (&mHotkeyList, Link);\r
}\r