]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFrameworkModulePkg GenericBdsLib: Resolve array size mismatch
authorHao Wu <hao.a.wu@intel.com>
Tue, 7 Jul 2015 06:13:53 +0000 (06:13 +0000)
committerhwu1225 <hwu1225@Edk2>
Tue, 7 Jul 2015 06:13:53 +0000 (06:13 +0000)
Match the size of array GaugeString defined in function
WriteBootToOsPerformanceData() with the size of field 'Token' defined in
struct PERF_DATA in MdeModulePkg\Include\Guid\Performance.h.

Doing so will ensure the size consistency when doing StrCpyS() between
PERF_DATA.Token and GaugeString (like here in Performance.c).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17851 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c

index 000542bdceb83397aa97cc046bc61d3522bb4eb4..78039e79a578eca477f1ce58febff86b90f76959 100644 (file)
@@ -40,7 +40,7 @@ GetShortPdbFileName (
   UINTN EndIndex;\r
 \r
   if (PdbFileName == NULL) {\r
-    AsciiStrCpyS (GaugeString, PERF_TOKEN_LENGTH, " ");\r
+    AsciiStrCpyS (GaugeString, PERF_TOKEN_SIZE, " ");\r
   } else {\r
     StartIndex = 0;\r
     for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++)\r
@@ -60,7 +60,7 @@ GetShortPdbFileName (
     for (Index = StartIndex; Index < EndIndex; Index++) {\r
       GaugeString[Index1] = PdbFileName[Index];\r
       Index1++;\r
-      if (Index1 == PERF_TOKEN_LENGTH - 1) {\r
+      if (Index1 == PERF_TOKEN_LENGTH) {\r
         break;\r
       }\r
     }\r
@@ -91,7 +91,7 @@ GetNameFromHandle (
   CHAR8                       *PdbFileName;\r
   EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;\r
 \r
-  AsciiStrCpyS (GaugeString, PERF_TOKEN_LENGTH, " ");\r
+  AsciiStrCpyS (GaugeString, PERF_TOKEN_SIZE, " ");\r
 \r
   //\r
   // Get handle name from image protocol\r
@@ -153,7 +153,7 @@ WriteBootToOsPerformanceData (
   UINT32                    LimitCount;\r
   EFI_HANDLE                *Handles;\r
   UINTN                     NoHandles;\r
-  CHAR8                     GaugeString[PERF_TOKEN_LENGTH];\r
+  CHAR8                     GaugeString[PERF_TOKEN_SIZE];\r
   UINT8                     *Ptr;\r
   UINT32                    Index;\r
   UINT64                    Ticker;\r