]> granicus.if.org Git - neomutt/commitdiff
Avoid an infinite loop in the pager. From Edmund Grimley Evans.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 12 Feb 2001 10:28:25 +0000 (10:28 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 12 Feb 2001 10:28:25 +0000 (10:28 +0000)
pager.c

diff --git a/pager.c b/pager.c
index 93bf767f3746641b4eaa95f564e46c8965cc83f7..1930e40c6b13c1688e9e1a01bbef42ef24219fd2 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -991,9 +991,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
       ch = grok_ansi (buf, ch+2, pa) + 1;
 
     k = mbrtowc (&wc, (char *)buf+ch, cnt-ch, &mbstate);
-    if (k == -2)
-      break;
-    if (k == -1)
+    if (k == -2 || k == -1)
     {
       if (col + 4 > COLS)
        break;