diff options
Diffstat (limited to 'include/just_gtfs/just_gtfs.h')
-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))); |