From 2de293cd96294c314999e6935b46d6d12d2091f9 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Thu, 21 Jan 2016 18:40:44 +0000 Subject: [PATCH] ShellPkg: BcfgDisplayDump(): print optional data with DumpHex() The DumpHex() function produces very friendly output (known from DMPSTORE, for example); let's use it with "BCFG -v" as well. Cc: Jaben Carsey Cc: Ryan Harkin Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jaben Carsey git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19718 6f19259b-4bc3-4df7-8a09-765794883524 --- .../UefiShellBcfgCommandLib.c | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c index 64e427029b..6a078d81cc 100644 --- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c +++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c @@ -1048,7 +1048,6 @@ BcfgDisplayDump( UINTN BufferSize; CHAR16 VariableName[12]; UINTN LoopVar; - UINTN LoopVar2; CHAR16 *DevPathString; VOID *FilePathList; UINTN Errors; @@ -1135,19 +1134,13 @@ BcfgDisplayDump( DevPathString, OptionalDataOffset >= BufferSize ? L'N' : L'Y' ); - if (VerboseOutput) { - for (LoopVar2 = OptionalDataOffset; LoopVar2 < BufferSize; LoopVar2++){ - ShellPrintEx( - -1, - -1, - L"%02x", - Buffer[LoopVar2]); - } - ShellPrintEx( - -1, - -1, - NULL, - L"\r\n"); + if (VerboseOutput && (OptionalDataOffset < BufferSize)) { + DumpHex ( + 2, // Indent + 0, // Offset (displayed) + BufferSize - OptionalDataOffset, // DataSize + Buffer + OptionalDataOffset // UserData + ); } Cleanup: