]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/VolInfo: Add definitions for command format strings
authorHao Wu <hao.a.wu@intel.com>
Sat, 8 Oct 2016 12:53:48 +0000 (20:53 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 8 Nov 2016 08:38:23 +0000 (16:38 +0800)
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/C/VolInfo/VolInfo.c
BaseTools/Source/C/VolInfo/VolInfo.h

index 5285acdb97f9ebe4cbfd1ed06fc13a5da983225e..46c72123c87538f8457b4d8fd835c4a9a70edef1 100644 (file)
@@ -1599,7 +1599,6 @@ Returns:
   CHAR8               *ExtractionTool;\r
   CHAR8               *ToolInputFile;\r
   CHAR8               *ToolOutputFile;\r
   CHAR8               *ExtractionTool;\r
   CHAR8               *ToolInputFile;\r
   CHAR8               *ToolOutputFile;\r
-  CHAR8               *SystemCommandFormatString;\r
   CHAR8               *SystemCommand;\r
   EFI_GUID            *EfiGuid;\r
   UINT16              DataOffset;\r
   CHAR8               *SystemCommand;\r
   EFI_GUID            *EfiGuid;\r
   UINT16              DataOffset;\r
@@ -1659,9 +1658,8 @@ Returns:
           SectionLength - SectionHeaderLen\r
           );\r
 \r
           SectionLength - SectionHeaderLen\r
           );\r
 \r
-        SystemCommandFormatString = "%s sha1 -out %s %s";\r
         SystemCommand = malloc (\r
         SystemCommand = malloc (\r
-          strlen (SystemCommandFormatString) +\r
+          strlen (OPENSSL_COMMAND_FORMAT_STRING) +\r
           strlen (OpenSslPath) +\r
           strlen (ToolInputFileName) +\r
           strlen (ToolOutputFileName) +\r
           strlen (OpenSslPath) +\r
           strlen (ToolInputFileName) +\r
           strlen (ToolOutputFileName) +\r
@@ -1673,7 +1671,7 @@ Returns:
         }\r
         sprintf (\r
           SystemCommand,\r
         }\r
         sprintf (\r
           SystemCommand,\r
-          SystemCommandFormatString,\r
+          OPENSSL_COMMAND_FORMAT_STRING,\r
           OpenSslPath,\r
           ToolOutputFileName,\r
           ToolInputFileName\r
           OpenSslPath,\r
           ToolOutputFileName,\r
           ToolInputFileName\r
@@ -1891,9 +1889,8 @@ Returns:
         //\r
         // Construction 'system' command string\r
         //\r
         //\r
         // Construction 'system' command string\r
         //\r
-        SystemCommandFormatString = "%s -d -o %s %s";\r
         SystemCommand = malloc (\r
         SystemCommand = malloc (\r
-          strlen (SystemCommandFormatString) +\r
+          strlen (EXTRACT_COMMAND_FORMAT_STRING) +\r
           strlen (ExtractionTool) +\r
           strlen (ToolInputFile) +\r
           strlen (ToolOutputFile) +\r
           strlen (ExtractionTool) +\r
           strlen (ToolInputFile) +\r
           strlen (ToolOutputFile) +\r
@@ -1909,7 +1906,7 @@ Returns:
         }\r
         sprintf (\r
           SystemCommand,\r
         }\r
         sprintf (\r
           SystemCommand,\r
-          SystemCommandFormatString,\r
+          EXTRACT_COMMAND_FORMAT_STRING,\r
           ExtractionTool,\r
           ToolOutputFile,\r
           ToolInputFile\r
           ExtractionTool,\r
           ToolOutputFile,\r
           ToolInputFile\r
index 0ef7d9222737a91f6f25eeb0f3c5bed3abad45db..dff64e7f534599544ad41e30bdb7a1606af451b2 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Local Definitions for the VolInfo utility\r
 \r
 /** @file\r
 Local Definitions for the VolInfo utility\r
 \r
-Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2016, 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
@@ -31,4 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define EFI_SECTION_LAST_LEAF_SECTION_TYPE  0x1B\r
 #define EFI_SECTION_LAST_SECTION_TYPE       0x1B\r
 \r
 #define EFI_SECTION_LAST_LEAF_SECTION_TYPE  0x1B\r
 #define EFI_SECTION_LAST_SECTION_TYPE       0x1B\r
 \r
+#define OPENSSL_COMMAND_FORMAT_STRING       "%s sha1 -out %s %s"\r
+#define EXTRACT_COMMAND_FORMAT_STRING       "%s -d -o %s %s"\r
+\r
 #endif\r
 #endif\r