From: Ben Pfaff Date: Sun, 1 Sep 2019 19:23:02 +0000 (+0000) Subject: AUTORECODE: Do not create value labels when they would be empty. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1b2d40a74005efbc4aa09609cc3bea4e2c16410;p=pspp AUTORECODE: Do not create value labels when they would be empty. --- diff --git a/src/language/stats/autorecode.c b/src/language/stats/autorecode.c index e5ab8070d7..66afb13afa 100644 --- a/src/language/stats/autorecode.c +++ b/src/language/stats/autorecode.c @@ -324,9 +324,12 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds) while (len > 0 && recoded_value[len - 1] == ' ') recoded_value[--len] = '\0'; - /* Add value label. */ - union value to_val = { .f = items[j]->to }; - var_add_value_label (spec->dst, &to_val, recoded_value); + /* Add value label, if it would be nonempty. */ + if (len) + { + union value to_val = { .f = items[j]->to }; + var_add_value_label (spec->dst, &to_val, recoded_value); + } free (recoded_value); }