X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fvariable.c;h=a60adcafcd8d25422f7be32d8f870059c2c028f3;hb=f15c854d8500105766b2f5666bb62b983ff24f88;hp=c0767d7ce245bcfdbcec0b25080228d7c9a38dbc;hpb=04d2c99833753252b724dd9d4f15cc3a80b6bec8;p=pspp-builds.git diff --git a/src/data/variable.c b/src/data/variable.c index c0767d7c..a60adcaf 100644 --- a/src/data/variable.c +++ b/src/data/variable.c @@ -149,13 +149,13 @@ var_clone (const struct variable *old_var) return new_var; } -/* Create a variable to be used for internal calculations only. - The variable is assigned a unique dictionary index and a case - index of CASE_IDX. */ +/* Create a variable of the specified WIDTH to be used for + internal calculations only. The variable is assigned a unique + dictionary index and a case index of CASE_IDX. */ struct variable * -var_create_internal (int case_idx) +var_create_internal (int case_idx, int width) { - struct variable *v = var_create ("$internal", 0); + struct variable *v = var_create ("$internal", width); struct vardict_info vdi; static int counter = INT_MAX / 2; @@ -592,8 +592,9 @@ var_append_value_name (const struct variable *v, const union value *value, const char *name = var_lookup_value_label (v, value); if (name == NULL) { - char *s = ds_put_uninit (str, v->print.w); - data_out (value, &v->print, s); + char *s = data_out (value, &v->print); + ds_put_cstr (str, s); + free (s); } else ds_put_cstr (str, name);