fixed: make sure vector has expected size

this comes from input that can be shorter (e.g. in the test
it only holds day-month-year).
This commit is contained in:
Arne Morten Kvarving 2023-11-17 12:37:05 +01:00
parent 003560e00d
commit 63a04d14e5

View File

@ -1084,6 +1084,9 @@ bool ESmry::make_esmry_file()
{ {
std::vector<int> start_date_vect = start_vect; std::vector<int> start_date_vect = start_vect;
if (start_date_vect.size() < 6) {
start_date_vect.resize(6);
}
int sec = start_date_vect[5] / 1000000; int sec = start_date_vect[5] / 1000000;
int millisec = (start_date_vect[5] % 1000000) / 1000; int millisec = (start_date_vect[5] % 1000000) / 1000;