Reworked very long string support for better encapsulation.
[pspp-builds.git] / src / data / dictionary.c
index f74ae00761dca42549cdb242865364a73c10a403..bf467440aa7ce294cb4f5a9aa7d0fdfef590d01a 100644 (file)
@@ -281,7 +281,7 @@ dict_create_var (struct dictionary *d, const char *name, int width)
   v->type = width == 0 ? NUMERIC : ALPHA;
   v->width = width;
   v->fv = d->next_value_idx;
-  v->nv = width_to_bytes(width) / MAX_SHORT_STRING ;
+  v->nv = width == 0 ? 1 : DIV_RND_UP (width, MAX_SHORT_STRING);
   v->leave = dict_class_from_id (v->name) == DC_SCRATCH;
   v->index = d->var_cnt;
   mv_init (&v->miss, width);