mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 00:06:16 +02:00
Merge pull request #2187 from bgamari/stoi-exceptions
json-to-value: Use strtol instead of strtoi
This commit is contained in:
commit
bd56b5fe3f
1 changed files with 1 additions and 1 deletions
|
@ -110,7 +110,7 @@ static void parseJSON(EvalState & state, const char * & s, Value & v)
|
||||||
if (number_type == tFloat)
|
if (number_type == tFloat)
|
||||||
mkFloat(v, stod(tmp_number));
|
mkFloat(v, stod(tmp_number));
|
||||||
else
|
else
|
||||||
mkInt(v, stoi(tmp_number));
|
mkInt(v, stol(tmp_number));
|
||||||
} catch (std::invalid_argument e) {
|
} catch (std::invalid_argument e) {
|
||||||
throw JSONParseError("invalid JSON number");
|
throw JSONParseError("invalid JSON number");
|
||||||
} catch (std::out_of_range e) {
|
} catch (std::out_of_range e) {
|
||||||
|
|
Loading…
Reference in a new issue