about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-05-26T22·43-0400
committerBen Gamari <ben@smart-cactus.org>2018-05-26T22·43-0400
commit7f560b81eae47f876cb652b0014f55af0c711dfd (patch)
treed22c9251e41c81949430c44e3cd97a7186b42771 /src
parent14c464b6c8d9acec40298923a45a7e3860f70ebf (diff)
json-to-value: Use strtol instead of strtoi
NixInt is long, so strtoi is too restrictive.
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/json-to-value.cc2
1 files changed, 1 insertions, 1 deletions
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) {