diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2021-10-25 17:42:00 +0200 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2021-10-26 17:07:09 +0200 |
commit | d3af7a353e75dadf283c58ad49cfe2dc81a4c9ce (patch) | |
tree | b5f441788f75eb7d3dabc1136b49f84cfbbb07a7 /plugins | |
parent | 50fc9b73a2127c8ed1944b8e3fd5f0f7b64ca8ec (diff) | |
download | monitoring-plugins-d3af7a353e75dadf283c58ad49cfe2dc81a4c9ce.tar.gz |
Remove useless lines and fix some formatting
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/utils.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/plugins/utils.c b/plugins/utils.c index f7f8952f..ff0e55d4 100644 --- a/plugins/utils.c +++ b/plugins/utils.c @@ -601,12 +601,16 @@ char *perfdata (const char *label, char *perfdata_uint64 (const char *label, uint64_t val, const char *uom, + int warnp, uint64_t warn, + int critp, uint64_t crit, + int minp, uint64_t minv, + int maxp, uint64_t maxv) { @@ -618,20 +622,16 @@ char *perfdata_uint64 (const char *label, xasprintf (&data, "%s=%ld%s;", label, val, uom); if (warnp) - xasprintf (&data, "%s%ld;", data, warn); - else - xasprintf (&data, "%s;", data); + xasprintf (&data, "%s%lu;", data, warn); if (critp) - xasprintf (&data, "%s%ld;", data, crit); - else - xasprintf (&data, "%s;", data); + xasprintf (&data, "%s%lu;", data, crit); if (minp) - xasprintf (&data, "%s%ld", data, minv); + xasprintf (&data, "%s%lu", data, minv); if (maxp) - xasprintf (&data, "%s;%ld", data, maxv); + xasprintf (&data, "%s;%lu", data, maxv); return data; } @@ -658,13 +658,9 @@ char *perfdata_int64 (const char *label, if (warnp) xasprintf (&data, "%s%ld;", data, warn); - else - xasprintf (&data, "%s;", data); if (critp) xasprintf (&data, "%s%ld;", data, crit); - else - xasprintf (&data, "%s;", data); if (minp) xasprintf (&data, "%s%ld", data, minv); |