From 9198ca27d09c68c4e1f2bac4e0b9867632ee5ed7 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Thu, 24 Mar 2022 14:46:40 +0100 Subject: [PATCH] conhost: Correctly recompute start of edit line on ReadConsole. Signed-off-by: Eric Pouech Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- programs/conhost/conhost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 11e97993fd8..461adc05bcc 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -1426,8 +1426,8 @@ static NTSTATUS read_console( struct console *console, unsigned int ioctl, size_ if (offset > ctx->home_x) { int deltay; - offset -= ctx->home_x; - deltay = offset / console->active->width; + offset -= ctx->home_x + 1; + deltay = offset / console->active->width + 1; if (ctx->home_y >= deltay) ctx->home_y -= deltay; else