projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
data_out function to dynamically allocate return value.
[pspp-builds.git]
/
src
/
data
/
variable.c
diff --git
a/src/data/variable.c
b/src/data/variable.c
index c0767d7ce245bcfdbcec0b25080228d7c9a38dbc..a60adcafcd8d25422f7be32d8f870059c2c028f3 100644
(file)
--- a/
src/data/variable.c
+++ b/
src/data/variable.c
@@
-149,13
+149,13
@@
var_clone (const struct variable *old_var)
return new_var;
}
return new_var;
}
-/* Create a variable
to be used for internal calculations only.
-
The variable is assigned a unique dictionary index and a cas
e
- index of CASE_IDX. */
+/* Create a variable
of the specified WIDTH to be used for
+
internal calculations only. The variable is assigned a uniqu
e
+
dictionary index and a case
index of CASE_IDX. */
struct variable *
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;
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)
{
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);
}
else
ds_put_cstr (str, name);