X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_sensu.c;h=71dd5854cfbebff0ac9c4b053c68034619e3d689;hb=d57e8e17bff41587242dd91df72bdda8f105eae9;hp=ddeecf83ef5aac283f8b88bc179a60f81a28e915;hpb=084761bb8a360ac0f9e21ad43c82312676cc4a37;p=collectd.git diff --git a/src/write_sensu.c b/src/write_sensu.c index ddeecf83..71dd5854 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -31,7 +31,6 @@ #include "common.h" #include "plugin.h" #include "utils_cache.h" - #include #include #include @@ -455,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); @@ -520,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");