]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
ShellPkg: BcfgDisplayDump(): print optional data with DumpHex()
[mirror_edk2.git] / ShellPkg / Library / UefiShellBcfgCommandLib / UefiShellBcfgCommandLib.c
index 64e427029b55e1d32cea7a6216139c79136e7e90..6a078d81cc31ae0547f8e790d5aad0f008645a77 100644 (file)
@@ -1048,7 +1048,6 @@ BcfgDisplayDump(
   UINTN           BufferSize;\r
   CHAR16          VariableName[12];\r
   UINTN           LoopVar;\r
-  UINTN           LoopVar2;\r
   CHAR16          *DevPathString;\r
   VOID            *FilePathList;\r
   UINTN           Errors;\r
@@ -1135,19 +1134,13 @@ BcfgDisplayDump(
       DevPathString,\r
       OptionalDataOffset >= BufferSize ? L'N' : L'Y'\r
       );\r
-    if (VerboseOutput) {\r
-      for (LoopVar2 = OptionalDataOffset; LoopVar2 < BufferSize; LoopVar2++){\r
-        ShellPrintEx(\r
-          -1,\r
-          -1,\r
-          L"%02x",\r
-          Buffer[LoopVar2]);\r
-      }\r
-      ShellPrintEx(\r
-        -1,\r
-        -1,\r
-        NULL,\r
-        L"\r\n");\r
+    if (VerboseOutput && (OptionalDataOffset < BufferSize)) {\r
+      DumpHex (\r
+        2,                               // Indent\r
+        0,                               // Offset (displayed)\r
+        BufferSize - OptionalDataOffset, // DataSize\r
+        Buffer + OptionalDataOffset      // UserData\r
+        );\r
     }\r
 \r
 Cleanup:\r