tab.c: Compile error in debug mode
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Sat, 4 Jun 2016 22:44:26 +0000 (00:44 +0200)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Sat, 4 Jun 2016 22:46:18 +0000 (00:46 +0200)
tab.c could not be compile with --enable-debug configuration because
the return value did not fit with the function. In addition a typo in
a "bad cell" check was fixed.

src/output/tab.c

index db384bdfc93408b434b08211ac774c03f60251a4..519be545f22c2b482feb3aa3162148259f23776b 100644 (file)
@@ -528,7 +528,7 @@ add_joined_cell (struct tab_table *table, int x1, int y1, int x2, int y2,
   if (x1 + table->col_ofs < 0 || x1 + table->col_ofs >= tab_nc (table)
       || y1 + table->row_ofs < 0 || y1 + table->row_ofs >= tab_nr (table)
       || x2 < x1 || x2 + table->col_ofs >= tab_nc (table)
-      || y2 < y2 || y2 + table->row_ofs >= tab_nr (table))
+      || y2 < y1 || y2 + table->row_ofs >= tab_nr (table))
     {
       printf ("tab_joint_text(): bad cell "
              "(%d+%d=%d,%d+%d=%d)-(%d+%d=%d,%d+%d=%d) in table size (%d,%d)\n",
@@ -537,7 +537,7 @@ add_joined_cell (struct tab_table *table, int x1, int y1, int x2, int y2,
              x2, table->col_ofs, x2 + table->col_ofs,
              y2, table->row_ofs, y2 + table->row_ofs,
              tab_nc (table), tab_nr (table));
-      return;
+      return NULL;
     }
 #endif