Eliminate temp_case, and a few other cleanups.
[pspp-builds.git] / src / pfm-read.c
index 0a13086281c757ecc4733fa764e6a679436731a7..8f19f1ba8779df7343b32b491f0861ea7c128313 100644 (file)
@@ -62,7 +62,7 @@ static struct fh_ext_class pfm_r_class;
 
 static int 
 corrupt_msg (struct file_handle *h, const char *format,...)
-  __attribute__ ((format (printf, 2, 3)));
+     PRINTF_FORMAT (2, 3);
 
 /* Displays a corruption error. */
 static int
@@ -617,11 +617,9 @@ static int
 convert_format (struct file_handle *h, int fmt[3], struct fmt_spec *v,
                struct variable *vv)
 {
-  if (fmt[0] < 0
-      || (size_t) fmt[0] >= sizeof translate_fmt / sizeof *translate_fmt)
+  v->type = translate_fmt (fmt[0]);
+  if (v->type == -1)
     lose ((h, _("%s: Bad format specifier byte (%d)."), vv->name, fmt[0]));
-
-  v->type = translate_fmt[fmt[0]];
   v->w = fmt[1];
   v->d = fmt[2];