summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index ebdae2e..b4214c6 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -589,10 +589,12 @@ char *perfdata (const char *label,
589 xasprintf (&data, "%s;", data); 589 xasprintf (&data, "%s;", data);
590 590
591 if (minp) 591 if (minp)
592 xasprintf (&data, "%s%ld", data, minv); 592 xasprintf (&data, "%s%ld;", data, minv);
593 else
594 xasprintf (&data, "%s;", data);
593 595
594 if (maxp) 596 if (maxp)
595 xasprintf (&data, "%s;%ld", data, maxv); 597 xasprintf (&data, "%s%ld", data, maxv);
596 598
597 return data; 599 return data;
598} 600}
@@ -613,27 +615,27 @@ char *perfdata_uint64 (const char *label,
613 char *data = NULL; 615 char *data = NULL;
614 616
615 if (strpbrk (label, "'= ")) 617 if (strpbrk (label, "'= "))
616 xasprintf (&data, "'%s'=%ld%s;", label, val, uom); 618 xasprintf (&data, "'%s'=%" PRIu64 "%s;", label, val, uom);
617 else 619 else
618 xasprintf (&data, "%s=%ld%s;", label, val, uom); 620 xasprintf (&data, "%s=%" PRIu64 "%s;", label, val, uom);
619 621
620 if (warnp) 622 if (warnp)
621 xasprintf (&data, "%s%lu;", data, warn); 623 xasprintf (&data, "%s%" PRIu64 ";", data, warn);
622 else 624 else
623 xasprintf (&data, "%s;", data); 625 xasprintf (&data, "%s;", data);
624 626
625 if (critp) 627 if (critp)
626 xasprintf (&data, "%s%lu;", data, crit); 628 xasprintf (&data, "%s%" PRIu64 ";", data, crit);
627 else 629 else
628 xasprintf (&data, "%s;", data); 630 xasprintf (&data, "%s;", data);
629 631
630 if (minp) 632 if (minp)
631 xasprintf (&data, "%s%lu;", data, minv); 633 xasprintf (&data, "%s%" PRIu64 ";", data, minv);
632 else 634 else
633 xasprintf (&data, "%s;", data); 635 xasprintf (&data, "%s;", data);
634 636
635 if (maxp) 637 if (maxp)
636 xasprintf (&data, "%s%lu", data, maxv); 638 xasprintf (&data, "%s%" PRIu64, data, maxv);
637 639
638 return data; 640 return data;
639} 641}
@@ -654,27 +656,27 @@ char *perfdata_int64 (const char *label,
654 char *data = NULL; 656 char *data = NULL;
655 657
656 if (strpbrk (label, "'= ")) 658 if (strpbrk (label, "'= "))
657 xasprintf (&data, "'%s'=%ld%s;", label, val, uom); 659 xasprintf (&data, "'%s'=%" PRId64 "%s;", label, val, uom);
658 else 660 else
659 xasprintf (&data, "%s=%ld%s;", label, val, uom); 661 xasprintf (&data, "%s=%" PRId64 "%s;", label, val, uom);
660 662
661 if (warnp) 663 if (warnp)
662 xasprintf (&data, "%s%ld;", data, warn); 664 xasprintf (&data, "%s%" PRId64 ";", data, warn);
663 else 665 else
664 xasprintf (&data, "%s;", data); 666 xasprintf (&data, "%s;", data);
665 667
666 if (critp) 668 if (critp)
667 xasprintf (&data, "%s%ld;", data, crit); 669 xasprintf (&data, "%s%" PRId64 ";", data, crit);
668 else 670 else
669 xasprintf (&data, "%s;", data); 671 xasprintf (&data, "%s;", data);
670 672
671 if (minp) 673 if (minp)
672 xasprintf (&data, "%s%ld;", data, minv); 674 xasprintf (&data, "%s%" PRId64 ";", data, minv);
673 else 675 else
674 xasprintf (&data, "%s;", data); 676 xasprintf (&data, "%s;", data);
675 677
676 if (maxp) 678 if (maxp)
677 xasprintf (&data, "%s%ld", data, maxv); 679 xasprintf (&data, "%s%" PRId64, data, maxv);
678 680
679 return data; 681 return data;
680} 682}