WSL/SLF GitLab Repository

Commit 9b4e7d06 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Fixed a bug in DAILY_AVG that made it crash on some datasets

parent d239580c
......@@ -181,9 +181,11 @@ size_t ResamplingAlgorithms::getDailyValue(const std::vector<MeteoData>& vecM, c
if (vecM[pos].date>=intervalStart) break;
}
if (vecM[pos].date>intervalEnd) {
for (; pos-- >0;)
for (size_t ii = pos; ii-- >0; ) {
pos=ii; //because ii gets corrupted at the final iteration if going all the way down
if (vecM[pos].date<=intervalEnd) break;
}
}
//look for daily sum before the current point
for (size_t ii=pos; ii-- >0; ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment