diff --git a/src/Config.cpp b/src/Config.cpp index 7b426af6f..3da32d102 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -563,7 +564,7 @@ std::string Config::get (const std::string& key) int Config::getInteger (const std::string& key) { if ((*this).find (key) != (*this).end ()) - return stoi ((*this)[key]); + return strtoimax ((*this)[key].c_str (), NULL, 10); return 0; } diff --git a/src/Nibbler.cpp b/src/Nibbler.cpp index 3c589174d..94b13d0c0 100644 --- a/src/Nibbler.cpp +++ b/src/Nibbler.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -263,7 +264,7 @@ bool Nibbler::getDigit4 (int& result) Lexer::isDigit ((*_input)[i + 2]) && Lexer::isDigit ((*_input)[i + 3])) { - result = std::stoi (_input->substr (_cursor, 4)); + result = strtoimax (_input->substr (_cursor, 4).c_str (), NULL, 10); _cursor += 4; return true; } @@ -283,7 +284,7 @@ bool Nibbler::getDigit3 (int& result) Lexer::isDigit ((*_input)[i + 1]) && Lexer::isDigit ((*_input)[i + 2])) { - result = std::stoi (_input->substr (_cursor, 3)); + result = strtoimax (_input->substr (_cursor, 3).c_str (), NULL, 10); _cursor += 3; return true; } @@ -302,7 +303,7 @@ bool Nibbler::getDigit2 (int& result) if (Lexer::isDigit ((*_input)[i + 0]) && Lexer::isDigit ((*_input)[i + 1])) { - result = std::stoi (_input->substr (_cursor, 2)); + result = strtoimax (_input->substr (_cursor, 2).c_str (), NULL, 10); _cursor += 2; return true; } @@ -330,7 +331,7 @@ bool Nibbler::getInt (int& result) if (i > _cursor) { - result = std::stoi (_input->substr (_cursor, i - _cursor)); + result = strtoimax (_input->substr (_cursor, i - _cursor).c_str (), NULL, 10); _cursor = i; return true; } @@ -348,7 +349,7 @@ bool Nibbler::getUnsignedInt (int& result) if (i > _cursor) { - result = std::stoi (_input->substr (_cursor, i - _cursor)); + result = strtoimax (_input->substr (_cursor, i - _cursor).c_str (), NULL, 10); _cursor = i; return true; }