Fixed crash from FLIP when a numeric variable is specified on NEWNAMES
[pspp] / src / numeric.c
index f80865d1dadce9aa1ec4cf63249729a93f06d114..1619a99af342236c7ccc78b0fb7e8adaaf794d3d 100644 (file)
@@ -27,8 +27,6 @@
 #include "str.h"
 #include "var.h"
 
-#undef DEBUGGING
-/*#define DEBUGGING 1*/
 #include "debug-print.h"
 
 /* Parses the NUMERIC command. */
@@ -75,8 +73,7 @@ cmd_numeric (void)
       /* Create each variable. */
       for (i = 0; i < nv; i++)
        {
-         struct variable *new_var = create_variable (&default_dict, v[i],
-                                              NUMERIC, 0);
+         struct variable *new_var = dict_create_var (default_dict, v[i], 0);
          if (!new_var)
            msg (SE, _("There is already a variable named %s."), v[i]);
          else
@@ -158,8 +155,8 @@ cmd_string (void)
       /* Create each variable. */
       for (i = 0; i < nv; i++)
        {
-         struct variable *new_var = create_variable (&default_dict, v[i],
-                                              ALPHA, width);
+         struct variable *new_var = dict_create_var (default_dict, v[i],
+                                                      width);
          if (!new_var)
            msg (SE, _("There is already a variable named %s."), v[i]);
          else
@@ -197,7 +194,7 @@ cmd_leave (void)
   int i;
 
   lex_match_id ("LEAVE");
-  if (!parse_variables (NULL, &v, &nv, PV_NONE))
+  if (!parse_variables (default_dict, &v, &nv, PV_NONE))
     return CMD_FAILURE;
   for (i = 0; i < nv; i++)
     {