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: Jeff Fan <jeff.fan@intel.com>
/** @file\r
Dynamically update the pages.\r
\r
/** @file\r
Dynamically update the pages.\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
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
//\r
// Build mode string Column x Row\r
//\r
//\r
// Build mode string Column x Row\r
//\r
- UnicodeValueToString (ModeString, 0, Col, 0);\r
+ UnicodeValueToStringS (ModeString, sizeof (ModeString), 0, Col, 0);\r
PStr = &ModeString[0];\r
StrCatS (PStr, ARRAY_SIZE (ModeString), L" x ");\r
PStr = PStr + StrLen (PStr);\r
PStr = &ModeString[0];\r
StrCatS (PStr, ARRAY_SIZE (ModeString), L" x ");\r
PStr = PStr + StrLen (PStr);\r
- UnicodeValueToString (PStr , 0, Row, 0);\r
+ UnicodeValueToStringS (\r
+ PStr,\r
+ sizeof (ModeString) - ((UINTN)PStr - (UINTN)&ModeString[0]),\r
+ 0,\r
+ Row,\r
+ 0\r
+ );\r
\r
ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);\r
\r
\r
ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);\r
\r
/** @file\r
The platform device manager reference implementation\r
\r
/** @file\r
The platform device manager reference implementation\r
\r
-Copyright (c) 2004 - 2015, 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
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
//\r
HwAddress = &MacAddressNode->MacAddress.Addr[0];\r
for (Index = 0; Index < HwAddressSize; Index++) {\r
//\r
HwAddress = &MacAddressNode->MacAddress.Addr[0];\r
for (Index = 0; Index < HwAddressSize; Index++) {\r
- String += UnicodeValueToString (String, PREFIX_ZERO | RADIX_HEX, *(HwAddress++), 2);\r
+ UnicodeValueToStringS (\r
+ String,\r
+ BufferLen - ((UINTN)String - (UINTN)*PBuffer),\r
+ PREFIX_ZERO | RADIX_HEX,\r
+ *(HwAddress++),\r
+ 2\r
+ );\r
+ String += StrnLenS (String, (BufferLen - ((UINTN)String - (UINTN)*PBuffer)) / sizeof (CHAR16));\r
if (Index < HwAddressSize - 1) {\r
*String++ = L':';\r
}\r
if (Index < HwAddressSize - 1) {\r
*String++ = L':';\r
}\r
\r
if (VlanId != 0) {\r
*String++ = L'\\';\r
\r
if (VlanId != 0) {\r
*String++ = L'\\';\r
- String += UnicodeValueToString (String, PREFIX_ZERO | RADIX_HEX, VlanId, 4);\r
+ UnicodeValueToStringS (\r
+ String,\r
+ BufferLen - ((UINTN)String - (UINTN)*PBuffer),\r
+ PREFIX_ZERO | RADIX_HEX,\r
+ VlanId,\r
+ 4\r
+ );\r
+ String += StrnLenS (String, (BufferLen - ((UINTN)String - (UINTN)*PBuffer)) / sizeof (CHAR16));\r
/** @file\r
FrontPage routines to handle the callbacks and browser calls\r
\r
/** @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
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
\r
StringBuffer = AllocateZeroPool (0x20);\r
ASSERT (StringBuffer != NULL);\r
\r
StringBuffer = AllocateZeroPool (0x20);\r
ASSERT (StringBuffer != NULL);\r
- Index = UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, FreqMhz / 1000, 3);\r
+ UnicodeValueToStringS (StringBuffer, 0x20, LEFT_JUSTIFY, FreqMhz / 1000, 3);\r
+ Index = StrnLenS (StringBuffer, 0x20 / sizeof (CHAR16));\r
StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L".");\r
StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L".");\r
- UnicodeValueToString (StringBuffer + Index + 1, PREFIX_ZERO, (FreqMhz % 1000) / 10, 2);\r
+ UnicodeValueToStringS (\r
+ StringBuffer + Index + 1,\r
+ 0x20 - sizeof (CHAR16) * (Index + 1),\r
+ PREFIX_ZERO,\r
+ (FreqMhz % 1000) / 10,\r
+ 2\r
+ );\r
StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L" GHz");\r
*String = (CHAR16 *) StringBuffer;\r
return ;\r
StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L" GHz");\r
*String = (CHAR16 *) StringBuffer;\r
return ;\r
\r
StringBuffer = AllocateZeroPool (0x20);\r
ASSERT (StringBuffer != NULL);\r
\r
StringBuffer = AllocateZeroPool (0x20);\r
ASSERT (StringBuffer != NULL);\r
- UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, MemorySize, 6);\r
+ UnicodeValueToStringS (StringBuffer, 0x20, LEFT_JUSTIFY, MemorySize, 6);\r
StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L" MB RAM");\r
\r
*String = (CHAR16 *) StringBuffer;\r
StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L" MB RAM");\r
\r
*String = (CHAR16 *) StringBuffer;\r
/** @file\r
Perform the platform memory test\r
\r
/** @file\r
Perform the platform memory test\r
\r
-Copyright (c) 2004 - 2015, 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
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
TempData\r
);\r
if (TestPercent != PreviousValue) {\r
TempData\r
);\r
if (TestPercent != PreviousValue) {\r
- UnicodeValueToString (StrPercent, 0, TestPercent, 0);\r
+ UnicodeValueToStringS (StrPercent, sizeof (StrPercent), 0, TestPercent, 0);\r
TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));\r
if (TmpStr != NULL) {\r
//\r
TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));\r
if (TmpStr != NULL) {\r
//\r
\r
Done:\r
if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
\r
Done:\r
if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {\r
- UnicodeValueToString (StrTotalMemory, COMMA_TYPE, TotalMemorySize, 0);\r
+ UnicodeValueToStringS (StrTotalMemory, StrTotalMemorySize, COMMA_TYPE, TotalMemorySize, 0);\r
if (StrTotalMemory[0] == L',') {\r
StrTotalMemory++;\r
StrTotalMemorySize -= sizeof (CHAR16);\r
if (StrTotalMemory[0] == L',') {\r
StrTotalMemory++;\r
StrTotalMemorySize -= sizeof (CHAR16);\r