From 9b82facd9cf6cb8b0d6ecacd2fc084f70650db62 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Wed, 15 Jun 2016 13:40:46 +0800 Subject: IntelFrameworkModulePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr It is the follow up of 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49 to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS. Cc: Jiewen Yao Cc: Jeff Fan Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jaben Carsey --- IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'IntelFrameworkModulePkg/Universal') diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index 6958979cdc..9f4d328357 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c @@ -1,7 +1,7 @@ /** @file FrontPage routines to handle the callbacks and browser calls -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -300,6 +300,7 @@ InitializeFrontPage ( EFI_STATUS Status; CHAR8 *LangCode; CHAR8 *Lang; + UINTN LangSize; CHAR8 *CurrentLang; UINTN OptionCount; CHAR16 *StringBuffer; @@ -448,9 +449,10 @@ InitializeFrontPage ( } if (EFI_ERROR (Status)) { - StringBuffer = AllocatePool (AsciiStrSize (Lang) * sizeof (CHAR16)); + LangSize = AsciiStrSize (Lang); + StringBuffer = AllocatePool (LangSize * sizeof (CHAR16)); ASSERT (StringBuffer != NULL); - AsciiStrToUnicodeStr (Lang, StringBuffer); + AsciiStrToUnicodeStrS (Lang, StringBuffer, LangSize); } ASSERT (StringBuffer != NULL); @@ -702,7 +704,7 @@ GetOptionalStringByIndex ( *String = GetStringById (STRING_TOKEN (STR_MISSING_STRING)); } else { *String = AllocatePool (StrSize * sizeof (CHAR16)); - AsciiStrToUnicodeStr (OptionalStrStart, *String); + AsciiStrToUnicodeStrS (OptionalStrStart, *String, StrSize); } return EFI_SUCCESS; -- cgit v1.2.3