do not overflow while there is a prompt - iomenu - interactive terminal-based selection menu HTML git clone git://bitreich.org/iomenu git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/iomenu DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 08cb917454e93c473c31b5628c5ed2876e9aad0d DIR parent cca472541716f796ab5f427f961e36acdc9ebaf8 HTML Author: Josuah Demangeonā ā µ <mail@josuah.net> Date: Wed, 5 Apr 2017 15:30:59 +0200 do not overflow while there is a prompt Diffstat: M iomenu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- DIR diff --git a/iomenu.c b/iomenu.c @@ -251,7 +251,7 @@ print_screen(void) { extern wchar_t formatted[BUFSIZ * 8]; - int cols = opt_l || matchc == 0 ? ws.ws_col : OFFSET - 3; + int cols = opt_l || matchc == 0 ? ws.ws_col - 2 : OFFSET - 3; fputws(L"\r\033[K", stderr); @@ -274,13 +274,12 @@ print_screen(void) for (int i = 0; formatted[i]; i++) fputwc(formatted[i], stderr); fputws(L" \033[m", stderr); - cols -= wcslen(formatted) + 3; + cols -= wcslen(formatted) + 1; } fputwc(L' ', stderr); /* input */ - cols = (opt_l || matchc == 0 ? cols : MAX(OFFSET, cols) - 3); format(input, cols); fputws(formatted, stderr);