summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-31 23:58:02 +0200
committerGitHub <noreply@github.com>2025-03-31 23:58:02 +0200
commit4924bc877f714ec00ac8b02378d11f1508bbe8b4 (patch)
tree276d2c7b746e593133cf1fc6ca548e10f71e1b5f /lib/utils_base.c
parent922d16ab2e44594d0ae4e4ac0c2b095cb1a1003f (diff)
parentd0647ec7e1500c0e6164ac9820a7d623582bdde2 (diff)
downloadmonitoring-plugins-4924bc877f714ec00ac8b02378d11f1508bbe8b4.tar.gz
Merge pull request #2113 from RincewindsHat/refactor/check_diskHEADmaster
Refactor/check disk
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r--lib/utils_base.c18
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;