diff options
-rw-r--r-- | lib/utils_base.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index ff9540c7..c49a473f 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
@@ -225,27 +225,15 @@ bool mp_check_range(const mp_perfdata_value value, const mp_range my_range) { | |||
225 | if (my_range.end_infinity == false && my_range.start_infinity == false) { | 225 | if (my_range.end_infinity == false && my_range.start_infinity == false) { |
226 | // range: .........|---inside---|........... | 226 | // range: .........|---inside---|........... |
227 | // value | 227 | // value |
228 | if ((cmp_perfdata_value(my_range.start, value) < 1) && (cmp_perfdata_value(value, my_range.end) <= 0)) { | 228 | is_inside = ((cmp_perfdata_value(my_range.start, value) < 1) && (cmp_perfdata_value(value, my_range.end) <= 0)); |
229 | is_inside = true; | ||
230 | } else { | ||
231 | is_inside = false; | ||
232 | } | ||
233 | } else if (my_range.start_infinity == false && my_range.end_infinity == true) { | 229 | } else if (my_range.start_infinity == false && my_range.end_infinity == true) { |
234 | // range: .........|---inside--------- | 230 | // range: .........|---inside--------- |
235 | // value | 231 | // value |
236 | if (cmp_perfdata_value(my_range.start, value) < 0) { | 232 | is_inside = (cmp_perfdata_value(my_range.start, value) < 0); |
237 | is_inside = true; | ||
238 | } else { | ||
239 | is_inside = false; | ||
240 | } | ||
241 | } else if (my_range.start_infinity == true && my_range.end_infinity == false) { | 233 | } else if (my_range.start_infinity == true && my_range.end_infinity == false) { |
242 | // range: -inside--------|.................... | 234 | // range: -inside--------|.................... |
243 | // value | 235 | // value |
244 | if (cmp_perfdata_value(value, my_range.end) == -1) { | 236 | is_inside = (cmp_perfdata_value(value, my_range.end) == -1); |
245 | is_inside = true; | ||
246 | } else { | ||
247 | is_inside = false; | ||
248 | } | ||
249 | } else { | 237 | } else { |
250 | // range from -inf to inf, so always inside | 238 | // range from -inf to inf, so always inside |
251 | is_inside = true; | 239 | is_inside = true; |