diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-11-12 05:28:42 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-11-12 05:28:42 +0000 |
commit | d7fa39a3e0124b56dd65e3459c405af67193ace6 (patch) | |
tree | 197f8ed8827b9776026913a0ce5d89a7c0f614f4 | |
parent | e1c26135d65eff851e5eb3ccfaf60791d372dc5d (diff) | |
download | monitoring-plugins-d7fa39a3e0124b56dd65e3459c405af67193ace6.tar.gz |
remove overflow checks of strtod - HUGE_VALF requires C99; also remove equality checks on warn/crit interval which are no doubles
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@764 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | plugins/check_dig.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index c67da30a..e348a352 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c @@ -141,10 +141,10 @@ main (int argc, char **argv) if (output == NULL || strlen (output) == 0) asprintf (&output, _(" Probably a non-existent host/domain")); - if (critical_interval != UNDEFINED && elapsed_time > critical_interval) + if (critical_interval > UNDEFINED && elapsed_time > critical_interval) result = STATE_CRITICAL; - else if (warning_interval != UNDEFINED && elapsed_time > warning_interval) + else if (warning_interval > UNDEFINED && elapsed_time > warning_interval) result = STATE_WARNING; asprintf (&output, _("%.3f seconds response time (%s)"), elapsed_time, output); @@ -152,9 +152,9 @@ main (int argc, char **argv) printf ("DNS %s - %s|%s\n", state_text (result), output, perfdata("time", microsec, "us", - (warning_interval!=UNDEFINED?TRUE:FALSE), + (warning_interval>UNDEFINED?TRUE:FALSE), (int)(1e6*warning_interval), - (critical_interval!=UNDEFINED?TRUE:FALSE), + (critical_interval>UNDEFINED?TRUE:FALSE), (int)(1e6*critical_interval), TRUE, 0, FALSE, 0)); return result; @@ -224,8 +224,6 @@ process_arguments (int argc, char **argv) case 'w': /* warning */ if (is_nonnegative (optarg)) { warning_interval = strtod (optarg, NULL); - if (warning_interval == HUGE_VAL) - usage2 (_("Input causes overflow in warning interval"), optarg); } else { usage2 (_("Warning interval must be a nonnegative integer"), optarg); @@ -234,8 +232,6 @@ process_arguments (int argc, char **argv) case 'c': /* critical */ if (is_nonnegative (optarg)) { critical_interval = strtod (optarg, NULL); - if (critical_interval == HUGE_VAL) - usage2 (_("Input causes overflow in critical interval"), optarg); } else { usage2 (_("Critical interval must be a nonnegative integer"), optarg); |