{
size_t const s = fread(read_buf, 1, n, input);
if (s == 0) {
- if (ferror(input))
+ /* on OS/X ferror appears to return true on eof as well when running
+ * the application in gdb... */
+ if (!feof(input) && ferror(input))
parse_error("read from input failed");
buf[MAX_PUTBACK] = EOF;
bufpos = buf + MAX_PUTBACK;
/* check for invalid octal digits */
for (size_t i= 0; i < size; ++i) {
char t = string[i];
- if (t == '8' || t == '9')
+ if (t >= '8')
errorf(&lexer_token.source_position,
"invalid digit '%c' in octal number", t);
}