mirror of
https://github.com/NixOS/nix.git
synced 2025-02-20 10:53:23 +00:00
json-to-value: Use strtol instead of strtoi
NixInt is long, so strtoi is too restrictive.
This commit is contained in:
parent
14c464b6c8
commit
7f560b81ea
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user