From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s9EII6Be002215 for ; Tue, 14 Oct 2014 14:18:06 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id s9EII5fB006949; Tue, 14 Oct 2014 14:18:05 -0400 (EDT) Date: Tue, 14 Oct 2014 14:18:05 -0400 (EDT) Message-Id: <201410141818.s9EII5fB006949@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: even if a table has zero columns, do not segfault in the X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- even if a table has zero columns, do not segfault in the formatter; bug reported by bentley@ Modified Files: -------------- mdocml: out.c tbl_term.c Revision Data ------------- Index: out.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/out.c,v retrieving revision 1.52 retrieving revision 1.53 diff -Lout.c -Lout.c -u -p -r1.52 -r1.53 --- out.c +++ out.c @@ -158,7 +158,7 @@ tblcalc(struct rofftbl *tbl, const struc tbl->cols = mandoc_calloc((size_t)sp->opts->cols, sizeof(struct roffcol)); - for (maxcol = 0; sp; sp = sp->next) { + for (maxcol = -1; sp; sp = sp->next) { if (TBL_SPAN_DATA != sp->pos) continue; spans = 1; Index: tbl_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/tbl_term.c,v retrieving revision 1.30 retrieving revision 1.31 diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.30 -r1.31 --- tbl_term.c +++ tbl_term.c @@ -107,7 +107,7 @@ term_tbl(struct termp *tp, const struct /* Vertical frame at the start of each row. */ if ((TBL_OPT_BOX | TBL_OPT_DBOX) & sp->opts->opts || - sp->head->vert) + (sp->head != NULL && sp->head->vert)) term_word(tp, TBL_SPAN_HORIZ == sp->pos || TBL_SPAN_DHORIZ == sp->pos ? "+" : "|"); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv