From: Ben Pfaff Date: Mon, 19 Nov 2007 01:06:05 +0000 (+0000) Subject: Correctly calculate n_missing_values field when writing variables that X-Git-Tag: v0.6.0~186 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd3e91d39a1f9b80c8e81e54942a1be1aed81213;p=pspp-builds.git Correctly calculate n_missing_values field when writing variables that include a range of missing values. --- diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 05bafc37..c66ddbd7 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,13 @@ +2007-11-18 Ben Pfaff + + Properly write variables that include a range of missing values to + system files. Thanks to Guido Gay for reporting + this bug. + + * sys-file-writer.c (write_variable): Correctly calculate + n_missing_values field when writing variables that include a range + of missing values. + 2007-11-10 Ben Pfaff Cleanups and bug fixes devised while writing up documentation. diff --git a/src/data/sys-file-writer.c b/src/data/sys-file-writer.c index acf9d5c0..fd663d69 100644 --- a/src/data/sys-file-writer.c +++ b/src/data/sys-file-writer.c @@ -421,7 +421,7 @@ write_variable (struct sfm_writer *w, const struct variable *v) /* Number of missing values. If there is a range, then the range counts as 2 missing values and causes the number to be negated. */ - write_int (w, mv_has_range (mv) ? 2 - mv_n_values (mv) : mv_n_values (mv)); + write_int (w, mv_has_range (mv) ? -2 - mv_n_values (mv) : mv_n_values (mv)); /* Print and write formats. */ write_format (w, *var_get_print_format (v), seg0_width);