[monitoring-plugins] Remove useless lines and fix some formatting

RincewindsHat git at monitoring-plugins.org
Thu Oct 28 16:20:12 CEST 2021


 Module: monitoring-plugins
 Branch: master
 Commit: d3af7a353e75dadf283c58ad49cfe2dc81a4c9ce
 Author: RincewindsHat <12514511+RincewindsHat at users.noreply.github.com>
   Date: Mon Oct 25 17:42:00 2021 +0200
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=d3af7a3

Remove useless lines and fix some formatting

---

 plugins/utils.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/plugins/utils.c b/plugins/utils.c
index f7f8952..ff0e55d 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);



More information about the Commits mailing list