From: Ben Pfaff Date: Sun, 25 Nov 2018 18:04:40 +0000 (-0800) Subject: render: Fix pathological case where column minimum width exceeds maximum. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e5149c53389133b2ef0c751f1684691fcdeb5d8;p=pspp render: Fix pathological case where column minimum width exceeds maximum. --- diff --git a/src/output/render.c b/src/output/render.c index 11830a3e8e..19244a14b8 100644 --- a/src/output/render.c +++ b/src/output/render.c @@ -784,6 +784,13 @@ render_page_create (const struct render_params *params, struct table *table) table_cell_free (&cell); } + /* In pathological cases, spans can cause the minimum width of a column to + exceed the maximum width. This bollixes our interpolation algorithm + later, so fix it up. */ + for (i = 0; i < nc; i++) + if (columns[MIN][i].width > columns[MAX][i].width) + columns[MAX][i].width = columns[MIN][i].width; + /* Decide final column widths. */ for (i = 0; i < 2; i++) table_widths[i] = calculate_table_width (table_nc (table),