Skip to content

Commit

Permalink
Return false when initial check in convert_from_string fails
Browse files Browse the repository at this point in the history
Otherwise, we currently have undefined behavior, as this method returns a bool, so we cannot just return without specifying what we are returning.
  • Loading branch information
AZero13 committed Oct 2, 2023
1 parent 1722ef9 commit 1c814d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/boost/math/cstdfloat/cstdfloat_iostream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@

if((p == static_cast<const char*>(0U)) || (*p == static_cast<char>(0)))
{
return;
return false;
}

bool is_neg = false;
Expand Down

0 comments on commit 1c814d8

Please sign in to comment.