]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
Shellpkg/editor: Fix a bug that may modifies Line[-1]
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / UefiShellDebug1CommandsLib.c
index d26d08f95c14c365ce2c6990eb55681172978950..b45e9a33f393529bfbb33ef9715c108d43e5e232 100644 (file)
@@ -205,7 +205,7 @@ EditorClearLine (
         //\r
         // if CHAR_NULL is still at position LastCol, it will cause first line error\r
         //\r
-        Line[(LastCol % (ARRAY_SIZE (Line) - 1)) - 1] = CHAR_NULL;\r
+        Line[(LastCol - 1) % (ARRAY_SIZE (Line) - 1)] = CHAR_NULL;\r
       } else {\r
         Line[LastCol % (ARRAY_SIZE (Line) - 1)] = CHAR_NULL;\r
       }\r