From 04b76ad8f4802f2fbd4f47e5f68f00feb5f70c40 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Sun, 23 Jul 2017 21:04:15 +0200 Subject: [PATCH] Fix truncated formating This patch fixes the leak of index line attributes on the next line due to the truncation of the output buffer based on terminal number of columns, forgetting to include escapes sequence at the end of the input buffer (#664). --- curs_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curs_lib.c b/curs_lib.c index 31d20f7bc..019fd78a4 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -1199,7 +1199,7 @@ void mutt_simple_format(char *dest, size_t destlen, int min_width, int max_width if (w >= 0) { if (w > max_width || (k2 = wcrtomb(scratch, wc, &mbstate2)) > destlen) - break; + continue; min_width -= w; max_width -= w; strncpy(p, scratch, k2); -- 2.40.0