From 122ff2eeb1279acad0cac2ed3e667ba162a698b1 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 4 Dec 2010 11:10:02 -0800 Subject: [PATCH] VALUE LABELS: Relax limit on value label length from 60 bytes to 255. Requested by friedrich nietzsche . With improvements by John Darrington. --- src/language/dictionary/value-labels.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/language/dictionary/value-labels.c b/src/language/dictionary/value-labels.c index 1471fc86..8c312ab8 100644 --- a/src/language/dictionary/value-labels.c +++ b/src/language/dictionary/value-labels.c @@ -121,6 +121,7 @@ get_label (struct lexer *lexer, struct variable **vars, size_t var_cnt) /* Parse all the labels and add them to the variables. */ do { + enum { MAX_LABEL_LEN = 255 }; int width = var_get_width (vars[0]); union value value; struct string label; @@ -144,10 +145,10 @@ get_label (struct lexer *lexer, struct variable **vars, size_t var_cnt) ds_init_substring (&label, lex_tokss (lexer)); - if (ds_length (&label) > 60) + if (ds_length (&label) > MAX_LABEL_LEN) { - msg (SW, _("Truncating value label to 60 characters.")); - ds_truncate (&label, 60); + msg (SW, _("Truncating value label to %d bytes."), MAX_LABEL_LEN); + ds_truncate (&label, MAX_LABEL_LEN); } for (i = 0; i < var_cnt; i++) -- 2.30.2