=================================================================== RCS file: /cvs/mandoc/tbl_term.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -p -r1.62 -r1.63 --- mandoc/tbl_term.c 2018/11/28 04:47:51 1.62 +++ mandoc/tbl_term.c 2018/11/28 13:43:54 1.63 @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.62 2018/11/28 04:47:51 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.63 2018/11/28 13:43:54 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011-2018 Ingo Schwarze @@ -437,11 +437,14 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) * but not after the last column. */ - if (fc == 0 && ((uvert == 0 && dvert == 0 && - (cp->next == NULL || + if (fc == 0 && + ((uvert == 0 && dvert == 0 && + cp != NULL && (cp->next == NULL || !IS_HORIZ(cp->next))) || - tp->tcol + 1 == tp->tcols + tp->lasttcol)) { - cp = cp->next; + tp->tcol + 1 == + tp->tcols + tp->lasttcol)) { + if (cp != NULL) + cp = cp->next; continue; }