/** @file\r
HII Config Access protocol implementation of VLAN configuration module.\r
\r
-Copyright (c) 2009 - 2014, 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
for (Index = 0; Index < NumberOfVlan; Index++) {\r
String = VlanStr;\r
\r
- StrCpy (String, L" VLAN ID:");\r
+ StrCpyS (String, (sizeof (VlanStr) /sizeof (CHAR16)), L" VLAN ID:");\r
String += 10;\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
- StrCpy (String + 4 - DigitalCount, VlanIdStr);\r
+ StrCpyS (String + 4 - DigitalCount, (sizeof (VlanStr) /sizeof (CHAR16)) - 10 - (4 - DigitalCount), VlanIdStr);\r
String += 4;\r
\r
- StrCpy (String, L", Priority:");\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
}\r
PrivateData->MacString = MacString;\r
\r
- StrCpy (Str, L"VLAN Configuration (MAC:");\r
- StrnCat (Str, MacString, sizeof (EFI_MAC_ADDRESS) * 2);\r
- StrCat (Str, L")");\r
+ StrCpyS (Str, sizeof (Str) / sizeof (CHAR16), L"VLAN Configuration (MAC:");\r
+ StrCatS (Str, sizeof (Str) / sizeof (CHAR16), MacString);\r
+ StrCatS (Str, sizeof (Str) / sizeof (CHAR16), L")");\r
HiiSetString (\r
HiiHandle,\r
STRING_TOKEN (STR_VLAN_FORM_SET_TITLE_HELP),\r