From cc3d82a25e4bc87b8a57024c28a3ce01fa4549cd Mon Sep 17 00:00:00 2001 From: tatiana-yan Date: Wed, 20 Jan 2021 13:24:17 +0300 Subject: Fix time format check. --- include/just_gtfs/just_gtfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/just_gtfs/just_gtfs.h b/include/just_gtfs/just_gtfs.h index b650cc4..4077c02 100644 --- a/include/just_gtfs/just_gtfs.h +++ b/include/just_gtfs/just_gtfs.h @@ -516,7 +516,7 @@ 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 <= 9) || (raw_time[len - 3] != ':' && raw_time[len - 6] != ':')) + 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(std::stoi(raw_time.substr(0, len - 6))); -- cgit v1.2.3