X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fwrite_sensu.c;h=b0c9254c7a6a6bef1d0b40fe6b662c337368769e;hp=ce23e654204a22f3fa4cc5e3f8aee4385976ae44;hb=7b8851b26928b609ce850e78c1eabb50ff319244;hpb=c99e3a4d169ada9299c73e20662d17debdc32e1f diff --git a/src/write_sensu.c b/src/write_sensu.c index ce23e654..b0c9254c 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -28,14 +28,14 @@ #include "collectd.h" +#include "common.h" +#include "plugin.h" +#include "utils_cache.h" #include #include #include #include #include -#include "common.h" -#include "plugin.h" -#include "utils_cache.h" #include #define SENSU_HOST "localhost" @@ -454,7 +454,7 @@ static char *sensu_value_to_json(struct sensu_host const *host, /* {{{ */ // incorporate the data source index { char ds_index[DATA_MAX_NAME_LEN]; - snprintf(ds_index, sizeof(ds_index), "%zu", index); + snprintf(ds_index, sizeof(ds_index), "%" PRIsz, index); res = my_asprintf(&temp_str, "%s, \"collectd_data_source_index\": %s", ret_str, ds_index); free(ret_str); @@ -519,7 +519,8 @@ static char *sensu_value_to_json(struct sensu_host const *host, /* {{{ */ return NULL; } } else { - res = my_asprintf(&value_str, "%llu", vl->values[index].counter); + res = my_asprintf(&value_str, "%" PRIu64, + (uint64_t)vl->values[index].counter); if (res == -1) { free(ret_str); ERROR("write_sensu plugin: Unable to alloc memory");