Fixed a bug causing pspp to crash when computed variables had no format
[pspp-builds.git] / src / flip.c
index de02119eb485166e7b45d57b2bc89880b59acd5b..f599fd78f0b399f65ce773d52e39ad5707cee335 100644 (file)
@@ -100,7 +100,7 @@ cmd_flip (void)
   temp_trns = temporary = 0;
   vfm_sink = &flip_stream;
   new_names_tail = NULL;
-  procedure (NULL, NULL, NULL);
+  procedure (NULL, NULL, NULL, NULL);
 
   dict_clear (default_dict);
   if (!build_dictionary ())
@@ -167,8 +167,7 @@ make_new_var (char name[])
 static int
 build_dictionary (void)
 {
-  if (!dict_create_var (default_dict, "CASE_LBL", 8))
-    assert (0);
+  dict_create_var_assert (default_dict, "CASE_LBL", 8);
 
   if (!new_names_tail)
     {
@@ -186,8 +185,7 @@ build_dictionary (void)
          char s[9];
 
          sprintf (s, "VAR%03d", i);
-         v = dict_create_var (default_dict, s, 0);
-          assert (v != NULL);
+         v = dict_create_var_assert (default_dict, s, 0);
        }
     }
   else
@@ -258,7 +256,7 @@ flip_stream_init (void)
 
 /* Reads the FLIP stream and passes it to write_case(). */
 static void
-flip_stream_read (void)
+flip_stream_read (write_case_func *write_case, write_case_data wc_data)
 {
   if (src || (src == NULL && src_file == NULL))
     {
@@ -276,7 +274,7 @@ flip_stream_read (void)
          for (iter = src, j = 1; iter; iter = iter->next, j++)
            temp_case->data[j].f = iter->v[i];
 
-         if (!write_case ())
+         if (!write_case (wc_data))
            return;
        }
     }
@@ -295,7 +293,7 @@ flip_stream_read (void)
            msg (FE, _("Error reading FLIP source file: %s."),
                 strerror (errno));
 
-         if (!write_case ())
+         if (!write_case (wc_data))
            return;
        }
     }