about summary refs log tree commit diff stats
path: root/src/TRSTable.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2016-09-14 01:09:14 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2016-09-14 01:09:14 -0400
commit86bd38ac80354d4d81432eacec12997dbc5c97fa (patch)
tree0f706edb0ba56baca0a6284e9c74fbf1ae6115c5 /src/TRSTable.c
parent48fe5d6c1f586f6a77ff68e50c78fbe8dda8a21b (diff)
downloadlynx-snapshots-86bd38ac80354d4d81432eacec12997dbc5c97fa.tar.gz
snapshot of project "lynx", label v2-8-9dev_9a
Diffstat (limited to 'src/TRSTable.c')
-rw-r--r--src/TRSTable.c13
1 files changed, 8 insertions, 5 deletions
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)