public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Bob Feng" <bob.c.feng@intel.com>
To: Konstantin Aladyshev <aladyshev22@gmail.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Gao, Liming" <gaoliming@byosoft.com.cn>,
	"Chen, Christine" <yuwei.chen@intel.com>
Subject: Re: [PATCH] BaseTools/VolInfo: Correct EFI_SECTION_VERSION display
Date: Sun, 24 Jul 2022 13:45:13 +0000	[thread overview]
Message-ID: <PH7PR11MB5863F07CA20C7F6EF8BF7D83C9929@PH7PR11MB5863.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220718094352.9834-1-aladyshev22@gmail.com>

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Konstantin Aladyshev <aladyshev22@gmail.com> 
Sent: Monday, July 18, 2022 5:44 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Konstantin Aladyshev <aladyshev22@gmail.com>
Subject: [PATCH] BaseTools/VolInfo: Correct EFI_SECTION_VERSION display

- Correct typo in print statement,
- "BuildNumber" field is UINT16, therefore it needs "0x%04X" format modifier,
- "VersionString" field is CHAR16, therefore the input data should be processed to be displayed with "%s" printf modifier.

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c
index 8b6fcffa48..ed56587058 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -1676,6 +1676,7 @@ Returns:
   CHAR8               *ToolInputFileName;   CHAR8               *ToolOutputFileName;   CHAR8               *UIFileName;+  CHAR8               *VersionString;    ParsedLength = 0;   ToolInputFileName = NULL;@@ -1816,8 +1817,14 @@ Returns:
       break;      case EFI_SECTION_VERSION:-      printf ("  Build Number:  0x%02X\n", *(UINT16 *)(Ptr + SectionHeaderLen));-      printf ("  Version Strg:  %s\n", (char*) (Ptr + SectionHeaderLen + sizeof (UINT16)));+      printf ("  Build Number:  0x%04X\n", *(UINT16 *)(Ptr + SectionHeaderLen));+      VersionString = (CHAR8 *) malloc (UnicodeStrLen (((EFI_VERSION_SECTION *) Ptr)->VersionString) + 1);+      if (VersionString == NULL) {+        Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");+        return EFI_OUT_OF_RESOURCES;+      }+      Unicode2AsciiString (((EFI_VERSION_SECTION *) Ptr)->VersionString, VersionString);+      printf ("  Version String:  %s\n", VersionString);       break;      case EFI_SECTION_COMPRESSION:-- 
2.25.1


      reply	other threads:[~2022-07-24 13:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18  9:43 [PATCH] BaseTools/VolInfo: Correct EFI_SECTION_VERSION display Konstantin Aladyshev
2022-07-24 13:45 ` Bob Feng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH7PR11MB5863F07CA20C7F6EF8BF7D83C9929@PH7PR11MB5863.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox