summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorAndreas Baumann <202930+andreasbaumann@users.noreply.github.com>2022-10-21 16:31:12 (GMT)
committerGitHub <noreply@github.com>2022-10-21 16:31:12 (GMT)
commit817ac2e5dad1ce5d0e0ea96fa7f726566251b08d (patch)
tree75f41457cd5ddd1eb1f21fda68aa0f9fc2349e76 /plugins/utils.c
parentd4f71ac2e7370e20b64150db0b859c9ba4b6a098 (diff)
downloadmonitoring-plugins-817ac2e5dad1ce5d0e0ea96fa7f726566251b08d.tar.gz
using PRId64 and PRIu64 instead of %ld directly (#1800)
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index 17dd581..f75cf03 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -615,27 +615,27 @@ char *perfdata_uint64 (const char *label,
615 char *data = NULL; 615 char *data = NULL;
616 616
617 if (strpbrk (label, "'= ")) 617 if (strpbrk (label, "'= "))
618 xasprintf (&data, "'%s'=%ld%s;", label, val, uom); 618 xasprintf (&data, "'%s'=%" PRId64 "%s;", label, val, uom);
619 else 619 else
620 xasprintf (&data, "%s=%ld%s;", label, val, uom); 620 xasprintf (&data, "%s=%" PRId64 "%s;", label, val, uom);
621 621
622 if (warnp) 622 if (warnp)
623 xasprintf (&data, "%s%lu;", data, warn); 623 xasprintf (&data, "%s%" PRIu64 ";", data, warn);
624 else 624 else
625 xasprintf (&data, "%s;", data); 625 xasprintf (&data, "%s;", data);
626 626
627 if (critp) 627 if (critp)
628 xasprintf (&data, "%s%lu;", data, crit); 628 xasprintf (&data, "%s%" PRIu64 ";", data, crit);
629 else 629 else
630 xasprintf (&data, "%s;", data); 630 xasprintf (&data, "%s;", data);
631 631
632 if (minp) 632 if (minp)
633 xasprintf (&data, "%s%lu;", data, minv); 633 xasprintf (&data, "%s%" PRIu64 ";", data, minv);
634 else 634 else
635 xasprintf (&data, "%s;", data); 635 xasprintf (&data, "%s;", data);
636 636
637 if (maxp) 637 if (maxp)
638 xasprintf (&data, "%s%lu", data, maxv); 638 xasprintf (&data, "%s%" PRIu64, data, maxv);
639 639
640 return data; 640 return data;
641} 641}
@@ -656,27 +656,27 @@ char *perfdata_int64 (const char *label,
656 char *data = NULL; 656 char *data = NULL;
657 657
658 if (strpbrk (label, "'= ")) 658 if (strpbrk (label, "'= "))
659 xasprintf (&data, "'%s'=%ld%s;", label, val, uom); 659 xasprintf (&data, "'%s'=%" PRId64 "%s;", label, val, uom);
660 else 660 else
661 xasprintf (&data, "%s=%ld%s;", label, val, uom); 661 xasprintf (&data, "%s=%" PRId64 "%s;", label, val, uom);
662 662
663 if (warnp) 663 if (warnp)
664 xasprintf (&data, "%s%ld;", data, warn); 664 xasprintf (&data, "%s%" PRId64 ";", data, warn);
665 else 665 else
666 xasprintf (&data, "%s;", data); 666 xasprintf (&data, "%s;", data);
667 667
668 if (critp) 668 if (critp)
669 xasprintf (&data, "%s%ld;", data, crit); 669 xasprintf (&data, "%s%" PRId64 ";", data, crit);
670 else 670 else
671 xasprintf (&data, "%s;", data); 671 xasprintf (&data, "%s;", data);
672 672
673 if (minp) 673 if (minp)
674 xasprintf (&data, "%s%ld;", data, minv); 674 xasprintf (&data, "%s%" PRId64 ";", data, minv);
675 else 675 else
676 xasprintf (&data, "%s;", data); 676 xasprintf (&data, "%s;", data);
677 677
678 if (maxp) 678 if (maxp)
679 xasprintf (&data, "%s%ld", data, maxv); 679 xasprintf (&data, "%s%" PRId64, data, maxv);
680 680
681 return data; 681 return data;
682} 682}