/** @file\r
HII Config Access protocol implementation of VLAN configuration module.\r
\r
-Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 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\r
of the BSD License which accompanies this distribution. The full\r
//\r
// Pad VlanId string up to 4 characters with space\r
//\r
- DigitalCount = UnicodeValueToString (VlanIdStr, 0, VlanData[Index].VlanId, 5);\r
+ UnicodeValueToStringS (VlanIdStr, sizeof (VlanIdStr), 0, VlanData[Index].VlanId, 5);\r
+ DigitalCount = StrnLenS (VlanIdStr, ARRAY_SIZE (VlanIdStr));\r
SetMem16 (String, (4 - DigitalCount) * sizeof (CHAR16), L' ');\r
StrCpyS (String + 4 - DigitalCount, (sizeof (VlanStr) /sizeof (CHAR16)) - 10 - (4 - DigitalCount), VlanIdStr);\r
String += 4;\r
\r
StrCpyS (String, (sizeof (VlanStr) /sizeof (CHAR16)) - 10 - (4 - DigitalCount) - 4, L", Priority:");\r
String += 11;\r
- String += UnicodeValueToString (String, 0, VlanData[Index].Priority, 4);\r
+ UnicodeValueToStringS (\r
+ String,\r
+ sizeof (VlanStr) - ((UINTN)String - (UINTN)VlanStr),\r
+ 0,\r
+ VlanData[Index].Priority,\r
+ 4\r
+ );\r
+ String += StrnLenS (String, ARRAY_SIZE (VlanStr) - ((UINTN)String - (UINTN)VlanStr) / sizeof (CHAR16));\r
*String = 0;\r
\r
StringId = HiiSetString (PrivateData->HiiHandle, 0, VlanStr, NULL);\r