- }
-
- if (c < 0)
- {
- if (ferror (fp))
- FATAL_ERROR ((0, errno, _("Read error in snapshot file")));
- else
- FATAL_ERROR ((0, 0, _("Unexpected EOF in snapshot file")));
- }
-
- buf[i] = 0;
- errno = 0;
- *pval = strtoimax (buf, &ep, 10);
- if (c || errno || *pval < min_val)
- FATAL_ERROR ((0, errno, _("Unexpected field value in snapshot file")));
-}
-
-/* Read from file FP a nul-terminated string and convert it to
- uintmax_t. Return an intmax_t representation of the resulting
- value in PVAL. Assume C has already been read.
-
- Throw a fatal error if the string cannot be converted or if the
- converted value exceeds MAX_VAL.
-
- Return the last character read or EOF on end of file. */
-
-static int
-read_unsigned_num (int c, FILE *fp, uintmax_t max_val, intmax_t *pval)
-{
- size_t i;
- uintmax_t u;
- char buf[UINTMAX_STRSIZE_BOUND], *ep;
-
- for (i = 0; ISDIGIT (c); i++)
- {