From 0934e6d63566d310cde14378e07d4baedc48b29c Mon Sep 17 00:00:00 2001 From: pjk Date: Tue, 27 Apr 2004 22:41:19 +0000 Subject: [PATCH] - Fixed bug in pool (free_all_gizmos) where gizmos pointer wasn't being NULLed after we freed all of the gizmos - Fixed bug in vfm (cancel_transformations) where we didn't NULL t_trns after freeing it - Updated routines around variable labels to allow 255 char. variable labels (this is supported by SPSS 11.0 at least...) This doesn't appear to break backward compat. Let me know if it does. --- src/aggregate.c | 2 +- src/pool.c | 1 + src/sfm-write.c | 4 ++-- src/var-labs.c | 6 +++--- src/vfm.c | 1 + 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/aggregate.c b/src/aggregate.c index 094756e9..32de72ef 100644 --- a/src/aggregate.c +++ b/src/aggregate.c @@ -387,7 +387,7 @@ parse_aggregate_functions (struct agr_proc *agr) if (token == T_STRING) { - ds_truncate (&tokstr, 120); + ds_truncate (&tokstr, 255); dest_label[n_dest - 1] = xstrdup (ds_value (&tokstr)); lex_get (); } diff --git a/src/pool.c b/src/pool.c index d3b536b2..41d4e748 100644 --- a/src/pool.c +++ b/src/pool.c @@ -643,6 +643,7 @@ free_all_gizmos (struct pool *pool) next = cur->next; free_gizmo (cur); } + pool->gizmos=NULL; } /* Memory allocation. */ diff --git a/src/sfm-write.c b/src/sfm-write.c index cb6bfa54..8769e235 100644 --- a/src/sfm-write.c +++ b/src/sfm-write.c @@ -381,13 +381,13 @@ write_variable (struct sfm_write_info *inf, struct variable *v) struct label { int32 label_len P; - char label[120] P; + char label[255] P; } l; int ext_len; - l.label_len = min (strlen (v->label), 120); + l.label_len = min (strlen (v->label), 255); ext_len = ROUND_UP (l.label_len, sizeof l.label_len); memcpy (l.label, v->label, l.label_len); memset (&l.label[l.label_len], ' ', ext_len - l.label_len); diff --git a/src/var-labs.c b/src/var-labs.c index a098e62a..48ef56a0 100644 --- a/src/var-labs.c +++ b/src/var-labs.c @@ -52,10 +52,10 @@ cmd_variable_labels (void) free (v); return CMD_PART_SUCCESS_MAYBE; } - if (ds_length (&tokstr) > 120) + if (ds_length (&tokstr) > 255) { - msg (SW, _("Truncating variable label to 120 characters.")); - ds_truncate (&tokstr, 120); + msg (SW, _("Truncating variable label to 255 characters.")); + ds_truncate (&tokstr, 255); } for (i = 0; i < nv; i++) { diff --git a/src/vfm.c b/src/vfm.c index 09c132f7..0d42ff5c 100644 --- a/src/vfm.c +++ b/src/vfm.c @@ -641,6 +641,7 @@ cancel_transformations (void) if (m_trns > 32) { free (t_trns); + t_trns=NULL; m_trns = 0; } } -- 2.30.2