]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c
MdeModulePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr
[mirror_edk2.git] / MdeModulePkg / Library / VarCheckHiiLib / VarCheckHiiGen.c
index 725ccc7d782afb98cd1d8e06d93252baa796d035..cab92967aa9a33031c9223de2fd6c9fb39e4f23d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Var Check Hii bin generation.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1130,13 +1130,13 @@ CreateHiiVariableNode (
   //\r
   // Get variable name.\r
   //\r
-  VarNameSize = AsciiStrSize ((CHAR8 *) IfrEfiVarStore->Name) * 2;\r
+  VarNameSize = AsciiStrSize ((CHAR8 *) IfrEfiVarStore->Name) * sizeof (CHAR16);\r
   if (VarNameSize > mMaxVarNameSize) {\r
     mVarName = InternalVarCheckReallocatePool (mMaxVarNameSize, VarNameSize, mVarName);\r
     ASSERT (mVarName != NULL);\r
     mMaxVarNameSize = VarNameSize;\r
   }\r
-  AsciiStrToUnicodeStr ((CHAR8 *) IfrEfiVarStore->Name, mVarName);\r
+  AsciiStrToUnicodeStrS ((CHAR8 *) IfrEfiVarStore->Name, mVarName, mMaxVarNameSize / sizeof (CHAR16));\r
   VarName = mVarName;\r
 \r
   HiiVariableNode = FindHiiVariableNode (\r