pspp-convert: Fix crash when the output file cannot be created.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 26 Aug 2017 23:33:01 +0000 (16:33 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 26 Aug 2017 23:33:01 +0000 (16:33 -0700)
tests/automake.mk
utilities/pspp-convert.c

index 31fddffddb7c3c1840bc87bfd0e65d013e474619..8d6d85fd7cb4541ec9183e8fa9468cdd3fe754d8 100644 (file)
@@ -420,6 +420,7 @@ TESTSUITE_AT = \
        tests/output/tables.at \
        tests/ui/terminal/main.at \
        tests/ui/syntax-gen.at \
+       tests/utilities/pspp-convert.at \
        tests/perl-module.at
 
 TESTSUITE = $(srcdir)/tests/testsuite
index cd760199d3813340626727db584c85e13bca992c..f21e5bdb8b907cb51a25a331d9311f436fc743e5 100644 (file)
@@ -203,6 +203,8 @@ main (int argc, char *argv[])
              output_filename);
       NOT_REACHED ();
     }
+  if (!writer)
+    error (1, 0, _("%s: error opening output file"), output_filename);
 
   for (i = 0; i < max_cases; i++)
     {