diff options
author | Khlopkova Olga <o.khlopkova@corp.mail.ru> | 2021-01-20 14:26:18 +0300 |
---|---|---|
committer | Khlopkova Olga <o.khlopkova@corp.mail.ru> | 2021-01-20 14:26:18 +0300 |
commit | 0b3559b70b183ddbf6fd7355bbfc62a383d431e4 (patch) | |
tree | 8db815868129ea09b5801c484de974b95a3d296b | |
parent | a840d79597724cf7a90484ad706cd77ea4855c52 (diff) |
Parse time >= 100 hours for multi-day routes.
-rw-r--r-- | just_gtfs.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/just_gtfs.h b/just_gtfs.h index a499433..4077c02 100644 --- a/just_gtfs.h +++ b/just_gtfs.h @@ -516,8 +516,8 @@ inline Time::Time(const std::string & raw_time_str) : raw_time(raw_time_str) return; const size_t len = raw_time.size(); - if (!(len == 7 || len == 8) || (raw_time[len - 3] != ':' && raw_time[len - 6] != ':')) - throw InvalidFieldFormat("Time is not in [H]H:MM:SS format: " + raw_time_str); + if (!(len >= 7 && len <= 9) || raw_time[len - 3] != ':' || raw_time[len - 6] != ':') + throw InvalidFieldFormat("Time is not in [[H]H]H:MM:SS format: " + raw_time_str); hh = static_cast<uint16_t>(std::stoi(raw_time.substr(0, len - 6))); mm = static_cast<uint16_t>(std::stoi(raw_time.substr(len - 5, 2))); |