diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index 8fe6b21e2..4b081af79 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -70,12 +70,12 @@ void TimePeriod::AddSegment(double begin, double end) if (segment->Get("begin") <= begin && segment->Get("end") >= end) return; /* New segment is fully contained in this segment. */ - if (segment->Get("begin") < begin && segment->Get("end") > begin) { + if (segment->Get("begin") <= begin && segment->Get("end") >= begin) { segment->Set("end", end); /* Extend an existing segment. */ return; } - if (segment->Get("begin") > begin && segment->Get("begin") < end) { + if (segment->Get("begin") >= begin && segment->Get("begin") <= end) { segment->Set("begin", begin); /* Extend an existing segment. */ return; }