From e0c4a3ec42bdf42b8a5afafd6b7683c3c880de1a Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 25 Sep 2024 04:02:47 +0200 Subject: [PATCH] epee: added support of "000" to string_to_num_fast --- contrib/epee/include/string_tools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/epee/include/string_tools.h b/contrib/epee/include/string_tools.h index 24dbffee..8cf56e5a 100644 --- a/contrib/epee/include/string_tools.h +++ b/contrib/epee/include/string_tools.h @@ -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;