//\r
// Allocate one more for the end tag.\r
//\r
- ListLength = sizeof (ParamList) / sizeof (ParamList[0]) + 1; \r
+ ListLength = ARRAY_SIZE (ParamList) + 1; \r
DpParamList = AllocatePool (sizeof (SHELL_PARAM_ITEM) * ListLength);\r
ASSERT (DpParamList != NULL);\r
\r
BOOLEAN CumulativeMode;\r
CONST CHAR16 *CustomCumulativeToken;\r
PERF_CUM_DATA *CustomCumulativeData;\r
+ UINTN NameSize;\r
EFI_HII_PACKAGE_LIST_HEADER *PackageList;\r
\r
EFI_STRING StringDpOptionQh;\r
CustomCumulativeData->MaxDur = 0;\r
CustomCumulativeData->Count = 0;\r
CustomCumulativeData->Duration = 0;\r
- CustomCumulativeData->Name = AllocateZeroPool (StrLen (CustomCumulativeToken) + 1);\r
- UnicodeStrToAsciiStr (CustomCumulativeToken, CustomCumulativeData->Name);\r
+ NameSize = StrLen (CustomCumulativeToken) + 1;\r
+ CustomCumulativeData->Name = AllocateZeroPool (NameSize);\r
+ UnicodeStrToAsciiStrS (CustomCumulativeToken, CustomCumulativeData->Name, NameSize);\r
}\r
\r
/****************************************************************************\r