From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5DCA681DFD for ; Thu, 3 Nov 2016 00:24:30 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP; 03 Nov 2016 00:24:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,585,1473145200"; d="scan'208";a="897185386" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.34]) by orsmga003.jf.intel.com with ESMTP; 03 Nov 2016 00:24:30 -0700 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Liming Gao , Yonghong Zhu Date: Thu, 3 Nov 2016 15:23:01 +0800 Message-Id: <1478157783-9368-52-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 In-Reply-To: <1478157783-9368-1-git-send-email-hao.a.wu@intel.com> References: <1478157783-9368-1-git-send-email-hao.a.wu@intel.com> Subject: [PATCH v2 51/53] BaseTools/VolInfo: Add definitions for command format strings X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2016 07:24:30 -0000 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- BaseTools/Source/C/VolInfo/VolInfo.c | 11 ++++------- BaseTools/Source/C/VolInfo/VolInfo.h | 5 ++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c index 5285acd..46c7212 100644 --- a/BaseTools/Source/C/VolInfo/VolInfo.c +++ b/BaseTools/Source/C/VolInfo/VolInfo.c @@ -1599,7 +1599,6 @@ Returns: CHAR8 *ExtractionTool; CHAR8 *ToolInputFile; CHAR8 *ToolOutputFile; - CHAR8 *SystemCommandFormatString; CHAR8 *SystemCommand; EFI_GUID *EfiGuid; UINT16 DataOffset; @@ -1659,9 +1658,8 @@ Returns: SectionLength - SectionHeaderLen ); - SystemCommandFormatString = "%s sha1 -out %s %s"; SystemCommand = malloc ( - strlen (SystemCommandFormatString) + + strlen (OPENSSL_COMMAND_FORMAT_STRING) + strlen (OpenSslPath) + strlen (ToolInputFileName) + strlen (ToolOutputFileName) + @@ -1673,7 +1671,7 @@ Returns: } sprintf ( SystemCommand, - SystemCommandFormatString, + OPENSSL_COMMAND_FORMAT_STRING, OpenSslPath, ToolOutputFileName, ToolInputFileName @@ -1891,9 +1889,8 @@ Returns: // // Construction 'system' command string // - SystemCommandFormatString = "%s -d -o %s %s"; SystemCommand = malloc ( - strlen (SystemCommandFormatString) + + strlen (EXTRACT_COMMAND_FORMAT_STRING) + strlen (ExtractionTool) + strlen (ToolInputFile) + strlen (ToolOutputFile) + @@ -1909,7 +1906,7 @@ Returns: } sprintf ( SystemCommand, - SystemCommandFormatString, + EXTRACT_COMMAND_FORMAT_STRING, ExtractionTool, ToolOutputFile, ToolInputFile diff --git a/BaseTools/Source/C/VolInfo/VolInfo.h b/BaseTools/Source/C/VolInfo/VolInfo.h index 0ef7d92..dff64e7 100644 --- a/BaseTools/Source/C/VolInfo/VolInfo.h +++ b/BaseTools/Source/C/VolInfo/VolInfo.h @@ -1,7 +1,7 @@ /** @file Local Definitions for the VolInfo utility -Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -31,4 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define EFI_SECTION_LAST_LEAF_SECTION_TYPE 0x1B #define EFI_SECTION_LAST_SECTION_TYPE 0x1B +#define OPENSSL_COMMAND_FORMAT_STRING "%s sha1 -out %s %s" +#define EXTRACT_COMMAND_FORMAT_STRING "%s -d -o %s %s" + #endif -- 1.9.5.msysgit.0