Merge pull request #2187 from bgamari/stoi-exceptions

json-to-value: Use strtol instead of strtoi
This commit is contained in:
Eelco Dolstra 2018-05-28 14:54:49 +02:00 committed by GitHub
commit bd56b5fe3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,7 +110,7 @@ static void parseJSON(EvalState & state, const char * & s, Value & v)
if (number_type == tFloat)
mkFloat(v, stod(tmp_number));
else
mkInt(v, stoi(tmp_number));
mkInt(v, stol(tmp_number));
} catch (std::invalid_argument e) {
throw JSONParseError("invalid JSON number");
} catch (std::out_of_range e) {