Allow output files to overwrite input files (bug #21280). Thanks to
[pspp-builds.git] / src / language / stats / aggregate.c
index b464a2890c7285c33474e3f82e2d26356232e912..18d78f238ae1f3038168cad0538d119c8903a0c5 100644 (file)
@@ -330,6 +330,7 @@ cmd_aggregate (struct lexer *lexer, struct dataset *ds)
     }
 
   agr_destroy (&agr);
+  fh_unref (out_file);
   return CMD_SUCCESS;
 
 error:
@@ -337,6 +338,7 @@ error:
     proc_commit (ds);
   casewriter_destroy (output);
   agr_destroy (&agr);
+  fh_unref (out_file);
   return CMD_CASCADING_FAILURE;
 }
 
@@ -485,8 +487,8 @@ parse_aggregate_functions (struct lexer *lexer, const struct dictionary *dict, s
                  }
                 else
                   {
-                   msg (SE, _("Missing argument %d to %s."),
-                         (int) i + 1, function->name);
+                   msg (SE, _("Missing argument %zu to %s."),
+                         i + 1, function->name);
                    goto error;
                  }
 
@@ -516,9 +518,9 @@ parse_aggregate_functions (struct lexer *lexer, const struct dictionary *dict, s
             like `unknown variable t'. */
          if (n_src != n_dest)
            {
-             msg (SE, _("Number of source variables (%u) does not match "
-                        "number of target variables (%u)."),
-                  (unsigned) n_src, (unsigned) n_dest);
+             msg (SE, _("Number of source variables (%zu) does not match "
+                        "number of target variables (%zu)."),
+                   n_src, n_dest);
              goto error;
            }