From 67f9d2244edd36bff6d69c2cdab7fd45c0d8e0fb Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Sun, 13 Jan 2002 08:52:15 +0000 Subject: [PATCH] A different fix for the '\012' issue. Bug tracked down by Johannes Geiger . --- muttlib.c | 4 +--- pager.c | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/muttlib.c b/muttlib.c index 72222316..53d696c3 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1227,9 +1227,7 @@ void state_attach_puts (const char *t, STATE *s) while (*t) { state_putc (*t, s); - if (*t++ == '\n' && *t && IsPrint (*t)) /* Is the IsPrint() here really - * the right way to fix this? - */ + if (*t++ == '\n' && *t) state_mark_attach (s); } } diff --git a/pager.c b/pager.c index 0a5de9da..2c5f1183 100644 --- a/pager.c +++ b/pager.c @@ -1051,9 +1051,14 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, check_attachment_marker ((char *) buf+ch) == 0) { while (buf[ch++] != '\a') - ; + if (ch >= cnt) + break; } + /* is anything left to do? */ + if (ch >= cnt) + break; + k = mbrtowc (&wc, (char *)buf+ch, cnt-ch, &mbstate); if (k == -2 || k == -1) { -- 2.40.0