diff --git a/reader.c b/reader.c index fb74605..5b5d974 100644 --- a/reader.c +++ b/reader.c @@ -342,29 +342,24 @@ static value_t read_number(reader_state_t *state) { case 'X': case 'x': - next_char(state); radix = 16; + next_char(state); break; case 'B': case 'b': - next_char(state); radix = 2; + next_char(state); break; case '0' ... '9': - ungetc(state->ch, state->file); - state->ch = '0'; radix = 8; break; default: - ungetc(state->ch, state->file); - state->ch = '0'; radix = 10; break; } - if (radix != 8) + if (radix != 10) { - /* Make sure we have at least one digit; if octal then the '0' counts instead */ release_assert(isalnum(state->ch)); release_assert(char_to_digit(state->ch) < radix); }