https://git.reactos.org/?p=reactos.git;a=commitdiff;h=15bf4d18d6aa54bc0050f…
commit 15bf4d18d6aa54bc0050fde7f1ef69f49eb82173
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Aug 7 19:18:04 2019 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Aug 7 19:18:04 2019 +0200
[FREELDR] Fix EditBox initial string display length: do not count the
NULL-terminator.
---
boot/freeldr/freeldr/ui/tui.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/boot/freeldr/freeldr/ui/tui.c b/boot/freeldr/freeldr/ui/tui.c
index b39e6fbc36d..8fd16aabc72 100644
--- a/boot/freeldr/freeldr/ui/tui.c
+++ b/boot/freeldr/freeldr/ui/tui.c
@@ -877,8 +877,8 @@ BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG
Length)
temp[j++] = MessageText[i];
}
- EditBoxTextLength = (ULONG)strlen(EditTextBuffer) + 1;
- EditBoxTextLength = min(EditBoxTextLength, Length);
+ EditBoxTextLength = (ULONG)strlen(EditTextBuffer);
+ EditBoxTextLength = min(EditBoxTextLength, Length - 1);
EditBoxTextPosition = 0;
EditBoxLine = y2 - 2;
EditBoxStartX = x1 + 3;