From dbf2e45a16d0a234dc7e513a8241479dc01284dc Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 26 Mar 2016 08:17:37 +0100 Subject: [PATCH] Fix assertion failure when using PRINT with an empty argument. Found by zzuf. --- src/output/ascii.c | 2 +- tests/output/ascii.at | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/output/ascii.c b/src/output/ascii.c index bd30677f20..66e0c4e0a6 100644 --- a/src/output/ascii.c +++ b/src/output/ascii.c @@ -457,7 +457,7 @@ ascii_output_table_item (struct ascii_driver *a, used = render_pager_draw_next (p, a->length - a->y); if (used == 0) { - assert (a->y > 0); + assert (a->y >= 0); ascii_close_page (a); if (!ascii_open_page (a)) break; diff --git a/tests/output/ascii.at b/tests/output/ascii.at index b4de68808e..d606e6ed88 100644 --- a/tests/output/ascii.at +++ b/tests/output/ascii.at @@ -653,3 +653,20 @@ Valid cases = 3; cases with missing value(s) = 0. ]) AT_CLEANUP + +AT_SETUP([ASCII crash on empty line]) + +AT_DATA([print.sps], [dnl +data list notable /x y 1-2. +begin data. +12 +end data. + +print. + +execute. +]) + +AT_CHECK([pspp print.sps], [0], [ignore]) + +AT_CLEANUP -- 2.30.2