From 8205fd2446de22d60e2b0429b122d506bbbe428a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 1 Nov 2015 21:46:32 -0500 Subject: [PATCH] ISO8601: Converted from strtol to std::stoi/stoul --- src/ISO8601.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 3a6e5d60d..1b3e111d7 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -1704,7 +1704,7 @@ ISO8601p::ISO8601p (const std::string& input) if (Lexer::isAllDigits (input)) { - time_t value = (time_t) strtol (input.c_str (), NULL, 10); + time_t value = static_cast (std::stoul (input)); if (value == 0 || value > 60) { _period = value; @@ -1865,8 +1865,7 @@ bool ISO8601p::parse (const std::string& input, std::string::size_type& start) // So as a special case, durations, with units of "d" are rejected if the // quantity exceeds 10000. // - if (unit == "d" && - strtol (number.c_str (), NULL, 10) > 10000) + if (unit == "d" && std::stoi (number) > 10000) return false; if (n.depleted () ||