summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2021-10-25 15:42:00 (GMT)
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2021-10-26 15:07:09 (GMT)
commitd3af7a353e75dadf283c58ad49cfe2dc81a4c9ce (patch)
treeb5f441788f75eb7d3dabc1136b49f84cfbbb07a7 /plugins/utils.c
parent50fc9b73a2127c8ed1944b8e3fd5f0f7b64ca8ec (diff)
downloadmonitoring-plugins-d3af7a353e75dadf283c58ad49cfe2dc81a4c9ce.tar.gz
Remove useless lines and fix some formatting
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c20
1 files 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,
601char *perfdata_uint64 (const char *label, 601char *perfdata_uint64 (const char *label,
602 uint64_t val, 602 uint64_t val,
603 const char *uom, 603 const char *uom,
604
604 int warnp, 605 int warnp,
605 uint64_t warn, 606 uint64_t warn,
607
606 int critp, 608 int critp,
607 uint64_t crit, 609 uint64_t crit,
610
608 int minp, 611 int minp,
609 uint64_t minv, 612 uint64_t minv,
613
610 int maxp, 614 int maxp,
611 uint64_t maxv) 615 uint64_t maxv)
612{ 616{
@@ -618,20 +622,16 @@ char *perfdata_uint64 (const char *label,
618 xasprintf (&data, "%s=%ld%s;", label, val, uom); 622 xasprintf (&data, "%s=%ld%s;", label, val, uom);
619 623
620 if (warnp) 624 if (warnp)
621 xasprintf (&data, "%s%ld;", data, warn); 625 xasprintf (&data, "%s%lu;", data, warn);
622 else
623 xasprintf (&data, "%s;", data);
624 626
625 if (critp) 627 if (critp)
626 xasprintf (&data, "%s%ld;", data, crit); 628 xasprintf (&data, "%s%lu;", data, crit);
627 else
628 xasprintf (&data, "%s;", data);
629 629
630 if (minp) 630 if (minp)
631 xasprintf (&data, "%s%ld", data, minv); 631 xasprintf (&data, "%s%lu", data, minv);
632 632
633 if (maxp) 633 if (maxp)
634 xasprintf (&data, "%s;%ld", data, maxv); 634 xasprintf (&data, "%s;%lu", data, maxv);
635 635
636 return data; 636 return data;
637} 637}
@@ -658,13 +658,9 @@ char *perfdata_int64 (const char *label,
658 658
659 if (warnp) 659 if (warnp)
660 xasprintf (&data, "%s%ld;", data, warn); 660 xasprintf (&data, "%s%ld;", data, warn);
661 else
662 xasprintf (&data, "%s;", data);
663 661
664 if (critp) 662 if (critp)
665 xasprintf (&data, "%s%ld;", data, crit); 663 xasprintf (&data, "%s%ld;", data, crit);
666 else
667 xasprintf (&data, "%s;", data);
668 664
669 if (minp) 665 if (minp)
670 xasprintf (&data, "%s%ld", data, minv); 666 xasprintf (&data, "%s%ld", data, minv);