summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c')
-rw-r--r--ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
index d109ca29a7..ca7ecd1751 100644
--- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
+++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
@@ -1055,6 +1055,7 @@ BcfgDisplayDump(
EFI_LOAD_OPTION *LoadOption;
CHAR16 *Description;
UINTN DescriptionSize;
+ UINTN OptionalDataOffset;
if (OrderCount == 0) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE), gShellBcfgHiiHandle, L"bcfg");
@@ -1118,6 +1119,10 @@ BcfgDisplayDump(
FilePathList = (UINT8 *)Description + DescriptionSize;
DevPathString = ConvertDevicePathToText(FilePathList, TRUE, FALSE);
}
+
+ OptionalDataOffset = sizeof *LoadOption + DescriptionSize +
+ LoadOption->FilePathListLength;
+
ShellPrintHiiEx(
-1,
-1,
@@ -1128,9 +1133,10 @@ BcfgDisplayDump(
VariableName,
Description,
DevPathString,
- (DescriptionSize + LoadOption->FilePathListLength + 6) <= BufferSize?L'N':L'Y');
+ OptionalDataOffset <= BufferSize ? L'N' : L'Y'
+ );
if (VerboseOutput) {
- for (LoopVar2 = (DescriptionSize + LoadOption->FilePathListLength + 6);LoopVar2<BufferSize;LoopVar2++){
+ for (LoopVar2 = OptionalDataOffset; LoopVar2 < BufferSize; LoopVar2++){
ShellPrintEx(
-1,
-1,