Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/just_gtfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortatiana-yan <tatiana.kondakova@gmail.com>2021-01-20 13:24:17 +0300
committertatiana-yan <tatiana.kondakova@gmail.com>2021-01-20 13:24:17 +0300
commitcc3d82a25e4bc87b8a57024c28a3ce01fa4549cd (patch)
treecbf12a17c5074556f0adae16e3594dca9ca65431
parentc3804b0d989ceee750d0fdd17ed46a76d6673406 (diff)
Fix time format check.
-rw-r--r--include/just_gtfs/just_gtfs.h2
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)));