dictionary: Limit split file variables to 8, for compatibility.
[pspp] / src / language / dictionary / split-file.c
index 8b4c8783371a8d165a1243c2896a9618f542f557..8a134e1e769eca5562e57e31febb49b9c29b03d0 100644 (file)
@@ -58,6 +58,14 @@ cmd_split_file (struct lexer *lexer, struct dataset *ds)
       if (!parse_variables (lexer, dataset_dict (ds), &v, &n, PV_NO_DUPLICATE))
        return CMD_CASCADING_FAILURE;
 
+      if (n > MAX_SPLITS)
+        {
+          verify (MAX_SPLITS == 8);
+          msg (SE, _("At most 8 split variables may be specified."));
+          free (v);
+          return CMD_CASCADING_FAILURE;
+        }
+
       dict_set_split_vars (dataset_dict (ds), v, n, type);
       free (v);
     }