=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.233 retrieving revision 1.235 diff -u -p -r1.233 -r1.235 --- mandoc/term.c 2014/10/29 00:17:43 1.233 +++ mandoc/term.c 2014/11/16 21:29:35 1.235 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.233 2014/10/29 00:17:43 schwarze Exp $ */ +/* $Id: term.c,v 1.235 2014/11/16 21:29:35 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -254,8 +254,10 @@ term_flushln(struct termp *p) * If there was trailing white space, it was not printed; * so reset the cursor position accordingly. */ - if (vis) + if (vis > vbl) vis -= vbl; + else + vis = 0; p->col = 0; p->overstep = 0; @@ -684,7 +686,7 @@ term_strlen(const struct termp *p, const char *cp) switch (esc) { case ESCAPE_UNICODE: - uc = mchars_num2uc(seq + 1, sz - 1); + uc = mchars_num2uc(seq + 1, ssz - 1); break; case ESCAPE_NUMBERED: uc = mchars_num2char(seq, ssz);