From 7bac32408e2564e29f81c9f8ece772248242e809 Mon Sep 17 00:00:00 2001 From: IRainman Date: Wed, 7 May 2025 22:14:55 +0300 Subject: [PATCH] fix for the parse_number_string --- include/fast_float/ascii_number.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index 58ca993..5432d16 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -473,13 +473,13 @@ parse_number_string(UC const *p, UC const *pend, // We need to be mindful of the case where we only have zeroes... // E.g., 0.000000000...000. UC const *start = start_digits; - do { // we already have some numbers, so we can skip first check safely - if ((*start == UC('0') || *start == options.decimal_point)) { - if (*start == UC('0')) { - --digit_count; - } + while ((start != pend) && + (*start == UC('0') || *start == options.decimal_point)) { + if (*start == UC('0')) { + --digit_count; } - } while (++start != pend); + ++start; + } // We have to check if we have a number with more than 19 significant // digits.