Skip to content

Commit

Permalink
atod(): add missing assertion len>0
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed Jun 6, 2024
1 parent 6cb8aca commit 6da8830
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/c4/charconv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2171,6 +2171,7 @@ inline size_t atof_first(csubstr str, float * C4_RESTRICT v) noexcept
*/
C4_ALWAYS_INLINE bool atod(csubstr str, double * C4_RESTRICT v) noexcept
{
C4_ASSERT(str.len > 0);
C4_ASSERT(str.triml(" \r\t\n").len == str.len);
#if C4CORE_HAVE_FAST_FLOAT
// fastfloat cannot parse hexadecimal floats
Expand Down

0 comments on commit 6da8830

Please sign in to comment.