1
0
Fork 0
forked from lthn/blockchain

epee: added support of "000" to string_to_num_fast

This commit is contained in:
sowle 2024-09-25 04:02:47 +02:00
parent 8c9582d0f7
commit e0c4a3ec42
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -444,7 +444,7 @@ POP_GCC_WARNINGS
inline bool string_to_num_fast(const std::string& buff, int& val)
{
val = atoi(buff.c_str());
if(buff != "0" && val == 0)
if (val == 0 && buff.find_first_not_of('0') != std::string::npos)
return false;
return true;