X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Ftab.c;h=f6b4886b1f4837327e830fb44cd0c14114878fe4;hb=a5955409d3679873d3bd6a0056e2aef92fbb0258;hp=3092c04372618938c2058364bacde9109491ac91;hpb=44daa45c8dcab1198280ebb71d35772a990d3e11;p=pspp diff --git a/src/output/tab.c b/src/output/tab.c index 3092c04372..f6b4886b1f 100644 --- a/src/output/tab.c +++ b/src/output/tab.c @@ -236,6 +236,21 @@ tab_vline (struct tab_table *t, int style, int x, int y1, int y2) void tab_hline (struct tab_table * t, int style, int x1, int x2, int y) { +#if DEBUGGING + if (y + t->row_ofs < 0 || y + t->row_ofs > tab_nr (t) + || x1 + t->col_ofs < 0 || x1 + t->col_ofs >= tab_nc (t) + || x2 + t->col_ofs < 0 || x2 + t->col_ofs >= tab_nc (t)) + { + printf (_("bad hline: x=(%d+%d=%d,%d+%d=%d) y=%d+%d=%d in " + "table size (%d,%d)\n"), + x1, t->col_ofs, x1 + t->col_ofs, + x2, t->col_ofs, x2 + t->col_ofs, + y, t->row_ofs, y + t->row_ofs, + tab_nc (t), tab_nr (t)); + return; + } +#endif + x1 += t->col_ofs; x2 += t->col_ofs; y += t->row_ofs;