From 4343f114cc661cf031ec915538c11b9b030e2e15 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Thu, 30 Sep 2021 14:18:50 +0000 Subject: =?UTF-8?q?Replace=20use=20of=20locale=20dependent=20atoi(?= =?UTF-8?q?=E2=80=A6)=20with=20locale-independent=20std::from=5Fchars(?= =?UTF-8?q?=E2=80=A6)=20(C++17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test: Add test cases for LocaleIndependentAtoi fuzz: Assert legacy atoi(s) == LocaleIndependentAtoi(s) fuzz: Assert legacy atoi64(s) == LocaleIndependentAtoi(s) --- src/util/strencodings.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/util/strencodings.cpp') diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp index 0aa80ea0ae..88fec6740a 100644 --- a/src/util/strencodings.cpp +++ b/src/util/strencodings.cpp @@ -403,20 +403,6 @@ std::string FormatParagraph(const std::string& in, size_t width, size_t indent) return out.str(); } -int64_t atoi64(const std::string& str) -{ -#ifdef _MSC_VER - return _atoi64(str.c_str()); -#else - return strtoll(str.c_str(), nullptr, 10); -#endif -} - -int atoi(const std::string& str) -{ - return atoi(str.c_str()); -} - /** Upper bound for mantissa. * 10^18-1 is the largest arbitrary decimal that will fit in a signed 64-bit integer. * Larger integers cannot consist of arbitrary combinations of 0-9: -- cgit v1.2.3