]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Application/UiApp/FrontPage.c
MdeModulePkg: Replace [Ascii|Unicode]ValueToString
[mirror_edk2.git] / MdeModulePkg / Application / UiApp / FrontPage.c
index bda5ff9231b98eb6853515fad4c1a7f07eba98b1..ad5af2cebbd3a54d0af90cd02fccacb053dee52f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   FrontPage routines to handle the callbacks and browser calls\r
 \r
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2017, 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
@@ -408,9 +408,16 @@ ConvertProcessorToString (
   DestMax = 0x20 / sizeof (CHAR16);\r
   StringBuffer = AllocateZeroPool (0x20);\r
   ASSERT (StringBuffer != NULL);\r
-  Index = UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, FreqMhz / 1000, 3);\r
+  UnicodeValueToStringS (StringBuffer, sizeof (CHAR16) * DestMax, LEFT_JUSTIFY, FreqMhz / 1000, 3);\r
+  Index = StrnLenS (StringBuffer, DestMax);\r
   StrCatS (StringBuffer, DestMax, L".");\r
-  UnicodeValueToString (StringBuffer + Index + 1, PREFIX_ZERO, (FreqMhz % 1000) / 10, 2);\r
+  UnicodeValueToStringS (\r
+    StringBuffer + Index + 1,\r
+    sizeof (CHAR16) * (DestMax - (Index + 1)),\r
+    PREFIX_ZERO,\r
+    (FreqMhz % 1000) / 10,\r
+    2\r
+    );\r
   StrCatS (StringBuffer, DestMax, L" GHz");\r
   *String = (CHAR16 *) StringBuffer;\r
   return ;\r
@@ -434,7 +441,7 @@ ConvertMemorySizeToString (
 \r
   StringBuffer = AllocateZeroPool (0x24);\r
   ASSERT (StringBuffer != NULL);\r
-  UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, MemorySize, 10);\r
+  UnicodeValueToStringS (StringBuffer, 0x24, LEFT_JUSTIFY, MemorySize, 10);\r
   StrCatS (StringBuffer, 0x24 / sizeof (CHAR16), L" MB RAM");\r
 \r
   *String = (CHAR16 *) StringBuffer;\r