forked from lthn/blockchain
epee: added support of "000" to string_to_num_fast
This commit is contained in:
parent
8c9582d0f7
commit
e0c4a3ec42
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue