From d3af7a353e75dadf283c58ad49cfe2dc81a4c9ce Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Mon, 25 Oct 2021 17:42:00 +0200 Subject: Remove useless lines and fix some formatting --- plugins/utils.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'plugins') 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); -- cgit v1.2.3-74-g34f1