Fix memory leaks.
[pspp-builds.git] / src / print.c
index 7f93f13f717296d31d11530a05011f7ba1030002..1bbc5ae6f8df07af94ed6cc0cfd94cd9b07ee7f5 100644 (file)
 /* FIXME: seems like a lot of code duplication with data-list.c. */
 
 #include <config.h>
-#include <assert.h>
+#include "error.h"
 #include <stdlib.h>
 #include "alloc.h"
+#include "case.h"
 #include "command.h"
 #include "dfm.h"
 #include "error.h"
@@ -338,7 +339,7 @@ parse_string_argument (void)
 {
   fx.spec.type = PRT_CONST;
   fx.spec.fc = fx.sc - 1;
-  fx.spec.u.c = xstrdup (ds_value (&tokstr));
+  fx.spec.u.c = xstrdup (ds_c_str (&tokstr));
   lex_get ();
 
   /* Parse the included column range. */
@@ -878,6 +879,7 @@ alloc_line (void)
        case PRT_ERROR:
         default:
          assert (0);
+          abort ();
        }
       if (pot_w > w)
        w = pot_w;
@@ -949,7 +951,7 @@ print_trns_proc (struct trns_header * trns, struct ccase * c,
        break;
 
       case PRT_VAR:
-        data_out (&buf[i->fc], &i->u.v.f, &c->data[i->u.v.v->fv]);
+        data_out (&buf[i->fc], &i->u.v.f, case_data (c, i->u.v.v->fv));
        len = i->fc + i->u.v.f.w;
        break;
 
@@ -1030,7 +1032,7 @@ cmd_print_space (void)
 
   if (token != '.')
     {
-      e = expr_parse (PXP_NUMERIC);
+      e = expr_parse (EXPR_NUMERIC);
       if (token != '.')
        {
          expr_free (e);