From: pjk Date: Tue, 27 Apr 2004 22:41:19 +0000 (+0000) Subject: - Fixed bug in pool (free_all_gizmos) where gizmos pointer wasn't being X-Git-Tag: v0.4.0~269 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0934e6d63566d310cde14378e07d4baedc48b29c;p=pspp-builds.git - 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. --- 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; } }