From dc93f25bb857568010f61594643adddca3e20040 Mon Sep 17 00:00:00 2001 From: stijn Date: Mon, 26 Oct 2015 11:49:48 +0100 Subject: [PATCH] windows: Erase pre-calc'd number of chars instead of clearing whole line. --- windows/windows_mphal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/windows/windows_mphal.c b/windows/windows_mphal.c index db03571baa..2a803f1089 100644 --- a/windows/windows_mphal.c +++ b/windows/windows_mphal.c @@ -96,10 +96,9 @@ void mp_hal_erase_line_from_cursor(uint n_chars_to_erase) { assure_conout_handle(); CONSOLE_SCREEN_BUFFER_INFO info; GetConsoleScreenBufferInfo(con_out, &info); - const short len = info.dwSize.X - info.dwCursorPosition.X; DWORD written; - FillConsoleOutputCharacter(con_out, ' ', len, info.dwCursorPosition, &written); - FillConsoleOutputAttribute(con_out, info.wAttributes, len, info.dwCursorPosition, &written); + FillConsoleOutputCharacter(con_out, ' ', n_chars_to_erase, info.dwCursorPosition, &written); + FillConsoleOutputAttribute(con_out, info.wAttributes, n_chars_to_erase, info.dwCursorPosition, &written); } typedef struct item_t {