From 7f560b81eae47f876cb652b0014f55af0c711dfd Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sat, 26 May 2018 18:43:46 -0400 Subject: json-to-value: Use strtol instead of strtoi NixInt is long, so strtoi is too restrictive. --- src/libexpr/json-to-value.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexpr/json-to-value.cc b/src/libexpr/json-to-value.cc index 8b1404595548..3f6017957782 100644 --- a/src/libexpr/json-to-value.cc +++ b/src/libexpr/json-to-value.cc @@ -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) { -- cgit 1.4.1