summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/termtable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/termtable.c b/lib/termtable.c
index 4f5f9ff218..01468b8203 100644
--- a/lib/termtable.c
+++ b/lib/termtable.c
@@ -163,7 +163,7 @@ static struct ttable_cell *ttable_insert_row_va(struct ttable *tt, int i,
orig = res;
- while (res) {
+ while (res && col < tt->ncols) {
section = strsep(&res, "|");
row[col].text = XSTRDUP(MTYPE_TTABLE, section);
row[col].style = tt->style.cell;