summaryrefslogtreecommitdiff
path: root/ShellPkg/Library
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-01-21 18:40:44 +0000
committerHao Wu <hao.a.wu@intel.com>2016-07-13 20:41:44 +0800
commit0586b054471f82724c0701fbd4ae2ddfb1807137 (patch)
tree2ec214faa48784f9b7aff2450ad0b6ad89c9c55c /ShellPkg/Library
parent9e2f5b11aa78b055bba31005ccd2efc31f3e3aac (diff)
downloadedk2-platforms-0586b054471f82724c0701fbd4ae2ddfb1807137.tar.xz
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 <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19718 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 2de293cd96294c314999e6935b46d6d12d2091f9)
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r--ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c21
1 files 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: