posix-xprintf-functions.patch from patch #6230.
[pspp-builds.git] / src / language / stats / aggregate.c
index a9e1e4a4284932639938a75e9058582d615616ea..c9d68d35da70867fccfaf92f0b7f5a1b08322f86 100644 (file)
@@ -36,7 +36,6 @@
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
 #include <language/stats/sort-criteria.h>
-#include <libpspp/alloc.h>
 #include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/misc.h>
@@ -46,6 +45,7 @@
 #include <math/sort.h>
 
 #include "minmax.h"
+#include "xalloc.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -291,7 +291,10 @@ cmd_aggregate (struct lexer *lexer, struct dataset *ds)
       struct ccase c;
 
       if (!casereader_peek (group, 0, &c))
-        continue;
+        {
+          casereader_destroy (group);
+          continue;
+        }
       initialize_aggregate_info (&agr, &c);
       case_destroy (&c);
 
@@ -482,8 +485,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;
                  }
 
@@ -513,9 +516,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;
            }