Fix error messages and comment.
[pspp-builds.git] / src / data / data-in.c
index 0b9e0623265562229d7982cdc0d86f5b99823fc2..c5556a3c78694d0b939547d82ba0c812231be661 100644 (file)
@@ -93,7 +93,7 @@ trim_whitespace (struct data_in *i)
     i->e--;
 }
 
-/* Returns nonzero if we're not at the end of the string being
+/* Returns true if we're not at the end of the string being
    parsed. */
 static inline bool
 have_char (struct data_in *i)
@@ -835,7 +835,8 @@ parse_trailer (struct data_in *i)
   if (!have_char (i))
     return true;
   
-  dls_error (i, _("Trailing garbage \"%s\" following date."), i->s);
+  dls_error (i, _("Trailing garbage \"%.*s\" following date."),
+             (int) (i->e - i->s), i->s);
   return false;
 }
 
@@ -1394,7 +1395,8 @@ data_in (struct data_in *i)
     }
   
   {
-    static bool (*const handlers[FMT_NUMBER_OF_FORMATS])(struct data_in *) = 
+    typedef bool (*handler_t) (struct data_in *);
+    static const handler_t handlers[FMT_NUMBER_OF_FORMATS] = 
       {
        parse_numeric, parse_N, parse_numeric, parse_numeric,
        parse_numeric, parse_numeric, parse_numeric,
@@ -1407,7 +1409,7 @@ data_in (struct data_in *i)
        parse_WKDAY, parse_MONTH,
       };
 
-    bool (*handler)(struct data_in *);
+    handler_t handler;
     bool success;
 
     handler = handlers[i->format.type];