Skip to content

Commit 8f64eae

Browse files
committed
Fix disallowed zero number in target parser.
1 parent d5537bf commit 8f64eae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parse/target.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
3535
template <typename Number>
3636
static bool to_number(Number& out, const std::string_view& token) NOEXCEPT
3737
{
38-
return !token.empty() && is_ascii_numeric(token) && token.front() != '0' &&
39-
deserialize(out, token);
38+
return !token.empty() && is_ascii_numeric(token) && (is_one(token.size()) ||
39+
token.front() != '0') && deserialize(out, token);
4040
}
4141

4242
static hash_cptr to_hash(const std::string_view& token) NOEXCEPT

0 commit comments

Comments
 (0)