From 86bd38ac80354d4d81432eacec12997dbc5c97fa Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Wed, 14 Sep 2016 01:09:14 -0400 Subject: snapshot of project "lynx", label v2-8-9dev_9a --- src/TRSTable.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/TRSTable.c') diff --git a/src/TRSTable.c b/src/TRSTable.c index c74a405b..9b9b3eb4 100644 --- a/src/TRSTable.c +++ b/src/TRSTable.c @@ -1,5 +1,5 @@ /* - * $LynxId: TRSTable.c,v 1.32 2014/12/16 01:30:48 tom Exp $ + * $LynxId: TRSTable.c,v 1.34 2016/09/14 01:02:44 tom Exp $ * Simple table object * =================== * Authors @@ -515,8 +515,9 @@ static int Stbl_reserveCellsInRow(STable_rowinfo *me, int icell, int growby = 1 + icell + colspan - me->allocated; CTRACE2(TRACE_TRST, - (tfp, "TRST:Stbl_reserveCellsInRow(icell=%d, colspan=%d\n", - icell, colspan)); + (tfp, + "TRST:Stbl_reserveCellsInRow(icell=%d, colspan=%d) growby=%d\n", + icell, colspan, growby)); if (growby > 0) { cells = typeRealloc(STable_cellinfo, me->cells, (unsigned) (me->allocated + growby)); @@ -1242,12 +1243,14 @@ static int get_remaining_colspan(STable_rowinfo *me, int ncols_sofar) { int i; - int last_colspan = me->ncells ? - me->cells[me->ncells - 1].colspan : 1; + int last_colspan = (me->ncells + ? me->cells[me->ncells - 1].colspan + : 1); if (ncolinfo == 0 || me->ncells + last_colspan > ncolinfo) { colspan = HTMIN(TRST_MAXCOLSPAN, ncols_sofar - (me->ncells + last_colspan - 1)); + colspan = HTMAX(colspan, 0); } else { for (i = me->ncells + last_colspan - 1; i < ncolinfo - 1; i++) if (colinfo[i].cLine == EOCOLG) -- cgit 1.4.1-2-gfad0