fix potential overflow in exponent reading