From f9a24380b8809d933317ac0fc0e3fe450d918374 Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Tue, 17 Nov 2015 10:09:25 +0000 Subject: [PATCH] MdeModulePkg: Use BM_OPTION_NAME_LEN instead of sizeof L"Boot####" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Reviewed-by: Sunny Wang git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18856 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c index ff1cbe933c..f902357255 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c @@ -45,7 +45,7 @@ BmIsKeyOptionValid ( IN EFI_BOOT_MANAGER_KEY_OPTION *KeyOption ) { - UINT16 OptionName[sizeof (L"Boot####")]; + UINT16 OptionName[BM_OPTION_NAME_LEN]; UINT8 *BootOption; UINTN BootOptionSize; UINT32 Crc; @@ -349,7 +349,7 @@ BmHotkeyCallback ( { LIST_ENTRY *Link; BM_HOTKEY *Hotkey; - CHAR16 OptionName[sizeof ("Boot####")]; + CHAR16 OptionName[BM_OPTION_NAME_LEN]; EFI_STATUS Status; EFI_KEY_DATA *HotkeyData; @@ -905,13 +905,13 @@ EfiBootManagerAddKeyOptionVariable ( VA_LIST Args; VOID *BootOption; UINTN BootOptionSize; - CHAR16 BootOptionName[sizeof (L"Boot####")]; + CHAR16 BootOptionName[BM_OPTION_NAME_LEN]; EFI_BOOT_MANAGER_KEY_OPTION KeyOption; EFI_BOOT_MANAGER_KEY_OPTION *KeyOptions; UINTN KeyOptionCount; UINTN Index; UINTN KeyOptionNumber; - CHAR16 KeyOptionName[sizeof (L"Key####")]; + CHAR16 KeyOptionName[sizeof ("Key####")]; UnicodeSPrint (BootOptionName, sizeof (BootOptionName), L"Boot%04x", BootOptionNumber); GetEfiGlobalVariable2 (BootOptionName, &BootOption, &BootOptionSize); @@ -1018,7 +1018,7 @@ EfiBootManagerDeleteKeyOptionVariable ( BM_HOTKEY *Hotkey; UINT32 ShiftState; BOOLEAN Match; - CHAR16 KeyOptionName[sizeof (L"Key####")]; + CHAR16 KeyOptionName[sizeof ("Key####")]; ZeroMem (&KeyOption, sizeof (EFI_BOOT_MANAGER_KEY_OPTION)); VA_START (Args, Modifier);