Fix assertion failure when using PRINT with an empty argument.
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 26 Mar 2016 07:17:37 +0000 (08:17 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 26 Mar 2016 07:17:37 +0000 (08:17 +0100)
Found by zzuf.

src/output/ascii.c
tests/output/ascii.at

index bd30677f20fb0be5f065d079dade4ecb6fbf35f9..66e0c4e0a6c83d4ed526afcb5dd5eadef82c6733 100644 (file)
@@ -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;
index b4de68808ee8d2f9f985be211e93e5aab0087058..d606e6ed884eb0e6efbd509738b11e787073cffa 100644 (file)
@@ -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