summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Application/UiApp/FrontPage.c
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2017-01-18 10:31:02 +0800
committerHao Wu <hao.a.wu@intel.com>2017-03-02 09:58:11 +0800
commit9f4048f7f8cd4b6bd5eee0f0c4bfd4eb6926a536 (patch)
tree0b3a079754cfcbf7c867e13d4eaefdc5545dcb23 /MdeModulePkg/Application/UiApp/FrontPage.c
parent0438f5e287fa40c7aa143c3a151c5e5c743411b3 (diff)
downloadedk2-9f4048f7f8cd4b6bd5eee0f0c4bfd4eb6926a536.tar.gz
edk2-9f4048f7f8cd4b6bd5eee0f0c4bfd4eb6926a536.tar.bz2
edk2-9f4048f7f8cd4b6bd5eee0f0c4bfd4eb6926a536.zip
MdeModulePkg: Replace [Ascii|Unicode]ValueToString
It is the follow up of commits 51f0ceb..9e32e97 to replace AsciiValueToString/UnicodeValueToString with AsciiValueToStringS/UnicodeValueToStringS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Application/UiApp/FrontPage.c')
-rw-r--r--MdeModulePkg/Application/UiApp/FrontPage.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/MdeModulePkg/Application/UiApp/FrontPage.c b/MdeModulePkg/Application/UiApp/FrontPage.c
index bda5ff9231..ad5af2cebb 100644
--- a/MdeModulePkg/Application/UiApp/FrontPage.c
+++ b/MdeModulePkg/Application/UiApp/FrontPage.c
@@ -1,7 +1,7 @@
/** @file
FrontPage routines to handle the callbacks and browser calls
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
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
@@ -408,9 +408,16 @@ ConvertProcessorToString (
DestMax = 0x20 / sizeof (CHAR16);
StringBuffer = AllocateZeroPool (0x20);
ASSERT (StringBuffer != NULL);
- Index = UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, FreqMhz / 1000, 3);
+ UnicodeValueToStringS (StringBuffer, sizeof (CHAR16) * DestMax, LEFT_JUSTIFY, FreqMhz / 1000, 3);
+ Index = StrnLenS (StringBuffer, DestMax);
StrCatS (StringBuffer, DestMax, L".");
- UnicodeValueToString (StringBuffer + Index + 1, PREFIX_ZERO, (FreqMhz % 1000) / 10, 2);
+ UnicodeValueToStringS (
+ StringBuffer + Index + 1,
+ sizeof (CHAR16) * (DestMax - (Index + 1)),
+ PREFIX_ZERO,
+ (FreqMhz % 1000) / 10,
+ 2
+ );
StrCatS (StringBuffer, DestMax, L" GHz");
*String = (CHAR16 *) StringBuffer;
return ;
@@ -434,7 +441,7 @@ ConvertMemorySizeToString (
StringBuffer = AllocateZeroPool (0x24);
ASSERT (StringBuffer != NULL);
- UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, MemorySize, 10);
+ UnicodeValueToStringS (StringBuffer, 0x24, LEFT_JUSTIFY, MemorySize, 10);
StrCatS (StringBuffer, 0x24 / sizeof (CHAR16), L" MB RAM");
*String = (CHAR16 *) StringBuffer;