diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c index 56ccd399b0..39a5afb53f 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c @@ -500,7 +500,7 @@ FileBufferPrintLine ( PrintLine = AllocatePool (BufLen); if (PrintLine != NULL) { StrnCpyS (PrintLine, BufLen/sizeof(CHAR16), Buffer, MIN(Limit, MainEditor.ScreenSize.Column)); - for (; Limit < MainEditor.ScreenSize.Column; Limit++) { + for (Limit = StrLen (PrintLine); Limit < MainEditor.ScreenSize.Column; Limit++) { PrintLine[Limit] = L' '; }