From 191186556e8df468bec99ae47cd09817e9d288a0 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 14 Oct 2014 18:18:05 +0000 Subject: even if a table has zero columns, do not segfault in the formatter; bug reported by bentley@ --- tbl_term.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tbl_term.c') diff --git a/tbl_term.c b/tbl_term.c index 6a733506..0275b1a2 100644 --- a/tbl_term.c +++ b/tbl_term.c @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.30 2014/10/14 02:16:06 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.31 2014/10/14 18:18:05 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2014 Ingo Schwarze @@ -107,7 +107,7 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) /* 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 ? "+" : "|"); -- cgit v1.2.3