diff options
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, | |||
601 | char *perfdata_uint64 (const char *label, | 601 | char *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); |