posix-xprintf-functions.patch from patch #6230.
[pspp-builds.git] / src / data / por-file-reader.c
index 8e6099f5d8ec5bed03ed9d19aca7b2ce32ac6b34..37ae23351a03fb332a4009381c6847cd30de2e40 100644 (file)
 #include <data/missing-values.h>
 #include <data/value-labels.h>
 #include <data/variable.h>
-#include <libpspp/alloc.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
-#include <libpspp/magic.h>
 #include <libpspp/message.h>
 #include <libpspp/misc.h>
 #include <libpspp/pool.h>
 #include <libpspp/str.h>
 
+#include "xalloc.h"
+
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
@@ -515,9 +515,9 @@ read_version_data (struct pfm_reader *r, struct pfm_read_info *info)
 
   /* Validate file. */
   if (strlen (date) != 8)
-    error (r, _("Bad date string length %d."), (int) strlen (date));
+    error (r, _("Bad date string length %zu."), strlen (date));
   if (strlen (time) != 6)
-    error (r, _("Bad time string length %d."), (int) strlen (time));
+    error (r, _("Bad time string length %zu."), strlen (time));
 
   /* Save file info. */
   if (info != NULL)
@@ -611,7 +611,7 @@ read_variables (struct pfm_reader *r, struct dictionary *dict)
     error (r, _("Expected variable count record."));
 
   r->var_cnt = read_int (r);
-  if (r->var_cnt <= 0 || r->var_cnt == NOT_INT)
+  if (r->var_cnt <= 0)
     error (r, _("Invalid number of variables %d."), r->var_cnt);
   r->widths = pool_nalloc (r->pool, r->var_cnt, sizeof *r->widths);