diff options
author | tatiana-yan <tatiana.kondakova@gmail.com> | 2021-01-20 13:02:43 +0300 |
---|---|---|
committer | tatiana-yan <tatiana.kondakova@gmail.com> | 2021-01-20 13:02:43 +0300 |
commit | c3804b0d989ceee750d0fdd17ed46a76d6673406 (patch) | |
tree | dd28e55fe4b4fa5fa248ac37852c270473b813ef | |
parent | 46996effa65b4db75f357180467968aed89cdf55 (diff) |
Parse time >= 100 hours for multi-day routes.
-rw-r--r-- | include/just_gtfs/just_gtfs.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/just_gtfs/just_gtfs.h b/include/just_gtfs/just_gtfs.h index a499433..b650cc4 100644 --- a/include/just_gtfs/just_gtfs.h +++ b/include/just_gtfs/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))); |