]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/Dp.c
UefiCpuPkg: Modify CpuIo2Dxe to use new IoLib library
[mirror_edk2.git] / PerformancePkg / Dp_App / Dp.c
index 6d980e5c55dc82d8956a8c3da673bb8e67c22a43..26a3ebcd1d0755ee86920252fe06f7dee85ba46e 100644 (file)
@@ -114,7 +114,7 @@ InitialShellParamList( void )
   //\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
@@ -221,6 +221,7 @@ InitializeDp (
   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
@@ -392,8 +393,9 @@ InitializeDp (
     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