Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17745
6f19259b-4bc3-4df7-8a09-
765794883524
/** @file\r
Utility functions used by the Dp application.\r
\r
/** @file\r
Utility functions used by the Dp application.\r
\r
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2015, 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
ZeroMem (UnicodeBuffer, DXE_PERFORMANCE_STRING_LENGTH * sizeof (CHAR16));\r
\r
if (PdbFileName == NULL) {\r
ZeroMem (UnicodeBuffer, DXE_PERFORMANCE_STRING_LENGTH * sizeof (CHAR16));\r
\r
if (PdbFileName == NULL) {\r
- StrCpy (UnicodeBuffer, L" ");\r
+ StrCpyS (UnicodeBuffer, DXE_PERFORMANCE_STRING_SIZE, L" ");\r
} else {\r
StartIndex = 0;\r
for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++)\r
} else {\r
StartIndex = 0;\r
for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++)\r
);\r
SafeFreePool (BestLanguage);\r
if (!EFI_ERROR (Status)) {\r
);\r
SafeFreePool (BestLanguage);\r
if (!EFI_ERROR (Status)) {\r
- StrnCpy (mGaugeString, StringPtr, DP_GAUGE_STRING_LENGTH);\r
- mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
+ StrCpyS (\r
+ mGaugeString,\r
+ DP_GAUGE_STRING_LENGTH + 1,\r
+ StringPtr\r
+ );\r
//\r
// Method 3. Get the name string from FFS UI section\r
//\r
//\r
// Method 3. Get the name string from FFS UI section\r
//\r
- StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
- mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
+ StrCpyS (\r
+ mGaugeString,\r
+ DP_GAUGE_STRING_LENGTH + 1,\r
+ NameString\r
+ );\r
FreePool (NameString);\r
} else {\r
//\r
FreePool (NameString);\r
} else {\r
//\r
//\r
NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
if (NameString != NULL) {\r
//\r
NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
if (NameString != NULL) {\r
- StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
- mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
+ StrCpyS (\r
+ mGaugeString,\r
+ DP_GAUGE_STRING_LENGTH + 1,\r
+ NameString\r
+ );\r
FreePool (NameString);\r
return;\r
}\r
FreePool (NameString);\r
return;\r
}\r
//\r
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_ERROR_NAME), NULL);\r
ASSERT (StringPtr != NULL);\r
//\r
StringPtr = HiiGetString (gHiiHandle, STRING_TOKEN (STR_DP_ERROR_NAME), NULL);\r
ASSERT (StringPtr != NULL);\r
- StrCpy (mGaugeString, StringPtr);\r
+ StrCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, StringPtr);\r
FreePool (StringPtr);\r
return;\r
}\r
FreePool (StringPtr);\r
return;\r
}\r