diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index a0edaa9..c91aed3 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -564,7 +564,7 @@ parse_int_string(UC const *p, UC const *pend, T &value, auto const *const start_digits = p; FASTFLOAT_IF_CONSTEXPR17((std::is_same::value)) { - const auto len = static_cast(pend - p); + const auto len = static_cast(pend - p); if (len == 0) { if (has_leading_zeros) { value = 0; @@ -608,7 +608,7 @@ parse_int_string(UC const *p, UC const *pend, T &value, const uint32_t magic = ((digits + 0x46464646u) | (digits - 0x30303030u)) & 0x80808080u; const auto tz = countr_zero_32(magic); // 7, 15, 23, 31, or 32 - am_bits_t nd = (tz == 32) ? 4 : (tz >> 3); + am_digits nd = (tz >> 3); nd = std::min(nd, len); if (nd == 0) { if (has_leading_zeros) {