diff options
author | tatiana-yan <tatiana.kondakova@gmail.com> | 2021-01-20 13:24:17 +0300 |
---|---|---|
committer | tatiana-yan <tatiana.kondakova@gmail.com> | 2021-01-20 13:24:17 +0300 |
commit | cc3d82a25e4bc87b8a57024c28a3ce01fa4549cd (patch) | |
tree | cbf12a17c5074556f0adae16e3594dca9ca65431 | |
parent | c3804b0d989ceee750d0fdd17ed46a76d6673406 (diff) |
Fix time format check.
-rw-r--r-- | include/just_gtfs/just_gtfs.h | 2 |
1 files changed, 1 insertions, 1 deletions
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<uint16_t>(std::stoi(raw_time.substr(0, len - 6))); |