]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Library/EdkIfrSupportLib/IfrVariable.c
Partially make EdkModulePkg pass intel IPF compiler with /W4 /WX switched on.
[mirror_edk2.git] / EdkModulePkg / Library / EdkIfrSupportLib / IfrVariable.c
index 3e37553668eccd3037e34a0d81a89c01b8bed485..a4aab0ff01ebf7e70588616eb3ee55374cdfab5f 100644 (file)
@@ -467,11 +467,15 @@ Returns:
 {\r
   EFI_STATUS    Status;\r
   CHAR16       *NameSuffixed;\r
 {\r
   EFI_STATUS    Status;\r
   CHAR16       *NameSuffixed;\r
+  UINTN         NameLength;\r
+  UINTN         SuffixLength;\r
 \r
   //\r
   // enough to concatenate both strings.\r
   //\r
 \r
   //\r
   // enough to concatenate both strings.\r
   //\r
-  NameSuffixed = AllocateZeroPool ((StrLen (Name) + StrLen (Suffix) + 1) * sizeof (CHAR16)); \r
+  NameLength   = StrLen (Name);\r
+  SuffixLength = StrLen (Suffix);\r
+  NameSuffixed = AllocateZeroPool ((NameLength + SuffixLength + 1) * sizeof (CHAR16)); \r
   \r
   StrCpy (NameSuffixed, Name);\r
   StrCat (NameSuffixed, Suffix);\r
   \r
   StrCpy (NameSuffixed, Name);\r
   StrCat (NameSuffixed, Suffix);\r