From: Ben Pfaff Date: Sat, 22 May 2010 18:33:48 +0000 (-0700) Subject: sys-file-reader: Fix reading overlong value labels for long string variables. X-Git-Tag: v0.7.6~417 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95064b9febe3b0be20b42b32d4dfa9099e306fe8;p=pspp-builds.git sys-file-reader: Fix reading overlong value labels for long string variables. Commit 6b562f8a8 "Add support for value labels on long string variables" that added support for reading value labels for long string variables from system files had a logic error in dealing with too-long label strings: the sign of the subtraction was reversed. Problem reported by Michel Boaventura . --- diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index 03234c2d..7aeb70d9 100644 --- a/src/data/sys-file-reader.c +++ b/src/data/sys-file-reader.c @@ -1679,7 +1679,7 @@ read_long_string_value_labels (struct sfm_reader *r, first 255 bytes. The maximum documented length of a label is 120 bytes so this is more than generous. */ - skip_bytes (r, sizeof label - (label_length + 1)); + skip_bytes (r, (label_length + 1) - sizeof label); } if (!skip && !var_add_value_label (v, &value, label))