X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdictionary.c;h=d04a4f70fa5ac64ced2b27552c360123ee978498;hb=cee6f0eb54144da7034566fa1bcdcee22337ae6a;hp=750d7858004d86d9bac70da1601fe94cd539ab29;hpb=e0589f0f27cbcd2b109bf9970b59046345f28c03;p=pspp diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 750d785800..d04a4f70fa 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -384,12 +384,15 @@ dict_unset_split_var (struct dictionary *d, struct variable *v, bool skip_callba } -/* Sets N split vars SPLIT in dictionary D. */ +/* Sets N split vars SPLIT in dictionary D. N is silently capped to a maximum + of MAX_SPLITS. */ static void dict_set_split_vars__ (struct dictionary *d, struct variable *const *split, size_t n, enum split_type type, bool skip_callbacks) { + if (n > MAX_SPLITS) + n = MAX_SPLITS; assert (n == 0 || split != NULL); d->n_splits = n; @@ -413,6 +416,12 @@ dict_set_split_vars__ (struct dictionary *d, } } +enum split_type +dict_get_split_type (const struct dictionary *d) +{ + return d->split_type; +} + /* Sets N split vars SPLIT in dictionary D. */ void dict_set_split_vars (struct dictionary *d,