diff --git a/common/json-schema-to-grammar.cpp b/common/json-schema-to-grammar.cpp index d6346913a..b5ead70aa 100644 --- a/common/json-schema-to-grammar.cpp +++ b/common/json-schema-to-grammar.cpp @@ -202,13 +202,13 @@ static void _generate_min_max_int(int min_value, int max_value, std::stringstrea } auto sub_len = from.length() - i - 1; if (sub_len > 0) { - out << "("; auto from_sub = from.substr(i + 1); auto to_sub = to.substr(i + 1); auto sub_zeros = repeat("0", sub_len); auto sub_nines = repeat("9", sub_len); auto to_reached = false; + out << "("; if (from_sub == sub_zeros) { digit_range(from[i], to[i] - 1); out << " ";