From: Ben Pfaff Date: Wed, 7 Feb 2007 03:58:45 +0000 (+0000) Subject: Give better error message on end of file. X-Git-Tag: v0.6.0~562 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e229c3779f9fb5e4bf7786a3bddf5e5d2441da28;p=pspp-builds.git Give better error message on end of file. --- diff --git a/src/language/stats/ChangeLog b/src/language/stats/ChangeLog index ef085bf7..2304f783 100644 --- a/src/language/stats/ChangeLog +++ b/src/language/stats/ChangeLog @@ -1,3 +1,7 @@ +Tue Feb 6 19:58:03 2007 Ben Pfaff + + * flip.c (flip_file): Give better error message on end-of-file. + 2007-02-04 Jason Stover * regression.q: Fixed p-value computation in the test for diff --git a/src/language/stats/flip.c b/src/language/stats/flip.c index c3f2439f..866ea2f7 100644 --- a/src/language/stats/flip.c +++ b/src/language/stats/flip.c @@ -448,7 +448,10 @@ flip_file (struct flip_pgm *flip) if (read_cases != fread (input_buf, case_bytes, read_cases, input_file)) { - msg (SE, _("Error reading FLIP file: %s."), strerror (errno)); + if (ferror (input_file)) + msg (SE, _("Error reading FLIP file: %s."), strerror (errno)); + else + msg (SE, _("Unexpected end of file reading FLIP file.")); return false; }