From e2941dbca864b84c681044569846e60042b7160d Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 5 Dec 2013 12:30:02 +0100 Subject: [PATCH] Make sure that TimePeriod segments are being merged properly. Refs #5268 --- lib/icinga/timeperiod.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }