summaryrefslogtreecommitdiffstats
path: root/tbl_data.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-01-10 15:31:00 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-01-10 15:31:00 +0000
commited5e3c51cf000a55a9774ad85994aa7c35abc0df (patch)
tree3038b4cd4495d286fb7980c27cff8a70b29e27f5 /tbl_data.c
parent8a26b665a342bbb1c095e7556e69d0995f952fe8 (diff)
downloadmandoc-ed5e3c51cf000a55a9774ad85994aa7c35abc0df.tar.gz
Clarify what members may be NULL or not in calculating widths. Make
sure signedness is correct. Verify that layouts MUST exit for data cells.
Diffstat (limited to 'tbl_data.c')
-rw-r--r--tbl_data.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tbl_data.c b/tbl_data.c
index 6172bd4a..b4da8fcd 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -188,8 +188,6 @@ tbl_data(struct tbl_node *tbl, int ln, const char *p)
* If there's no last parsed span, use the first row. Lastly,
* if the last span was a horizontal line, use the same layout
* (it doesn't "consume" the layout).
- *
- * In the end, this can be NULL!
*/
if (tbl->last_span) {
@@ -198,11 +196,14 @@ tbl_data(struct tbl_node *tbl, int ln, const char *p)
rp = tbl->last_span->layout->next;
else
rp = tbl->last_span->layout;
+
if (NULL == rp)
rp = tbl->last_span->layout;
} else
rp = tbl->first_row;
+ assert(rp);
+
dp = mandoc_calloc(1, sizeof(struct tbl_span));
dp->tbl = &tbl->opts;
dp->layout = rp;