Datafile: Fixed range rejection

This commit is contained in:
Paul Beckingham 2016-04-17 08:43:15 -04:00
parent b250e37b73
commit 3764c60f90

View file

@ -90,11 +90,12 @@ void Datafile::setExclusions (const std::vector <std::string>& exclusions)
}
////////////////////////////////////////////////////////////////////////////////
// Accepted intervals; day1 <= interval.start < dayN
bool Datafile::addInterval (const Interval& interval)
{
// Return false if the interval does not belong in this file.
// Note: end date might be zero.
if (interval.start () > _dayN ||
if (interval.start () >= _dayN ||
(interval.end ().toEpoch () && interval.end () < _day1))
return false;
@ -118,7 +119,7 @@ bool Datafile::deleteInterval (const Interval& interval)
{
// Return false if the interval does not belong in this file.
// Note: end date might be zero.
if (interval.start () > _dayN ||
if (interval.start () >= _dayN ||
(interval.end ().toEpoch () && interval.end () < _day1))
return false;