From 7891023bc75024553f2564017b685cdb13eeec33 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 26 Aug 2017 16:33:01 -0700 Subject: [PATCH] pspp-convert: Fix crash when the output file cannot be created. --- tests/automake.mk | 1 + utilities/pspp-convert.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/automake.mk b/tests/automake.mk index 31fddffddb..8d6d85fd7c 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -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 diff --git a/utilities/pspp-convert.c b/utilities/pspp-convert.c index cd760199d3..f21e5bdb8b 100644 --- a/utilities/pspp-convert.c +++ b/utilities/pspp-convert.c @@ -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++) { -- 2.30.2