X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnetlink.c;h=806265a28001ae49dddb839bb2ddd955163fb7e4;hb=21c84cec32921e6de8feaa5496f337496379ea23;hp=37c2e294971c1ca1d2f3a580c5abfeb6bb108f75;hpb=87f8f66a84e78fd37dd2767c032ce74924d31dfd;p=collectd.git diff --git a/src/netlink.c b/src/netlink.c index 37c2e294..806265a2 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -198,7 +198,8 @@ static void submit_two(const char *dev, const char *type, const char *type_instance, derive_t rx, derive_t tx) { value_list_t vl = VALUE_LIST_INIT; value_t values[] = { - {.derive = rx}, {.derive = tx}, + {.derive = rx}, + {.derive = tx}, }; vl.values = values; @@ -509,8 +510,8 @@ static int qos_filter_cb(const struct nlmsghdr *nlh, void *args) { if (strcmp(tc_type, "filter") == 0) numberic_id = tm->tcm_parent; - snprintf(tc_inst, sizeof(tc_inst), "%s-%x:%x", kind, numberic_id >> 16, - numberic_id & 0x0000FFFF); + ssnprintf(tc_inst, sizeof(tc_inst), "%s-%x:%x", kind, numberic_id >> 16, + numberic_id & 0x0000FFFF); } DEBUG("netlink plugin: qos_filter_cb: got %s for %s (%i).", tc_type, dev, @@ -541,8 +542,8 @@ static int qos_filter_cb(const struct nlmsghdr *nlh, void *args) { stats_submitted = true; - int r = snprintf(type_instance, sizeof(type_instance), "%s-%s", tc_type, - tc_inst); + int r = ssnprintf(type_instance, sizeof(type_instance), "%s-%s", tc_type, + tc_inst); if ((size_t)r >= sizeof(type_instance)) { ERROR("netlink plugin: type_instance truncated to %zu bytes, need %d", sizeof(type_instance), r); @@ -580,8 +581,8 @@ static int qos_filter_cb(const struct nlmsghdr *nlh, void *args) { if (!stats_submitted && ts != NULL) { char type_instance[DATA_MAX_NAME_LEN]; - int r = snprintf(type_instance, sizeof(type_instance), "%s-%s", tc_type, - tc_inst); + int r = ssnprintf(type_instance, sizeof(type_instance), "%s-%s", tc_type, + tc_inst); if ((size_t)r >= sizeof(type_instance)) { ERROR("netlink plugin: type_instance truncated to %zu bytes, need %d", sizeof(type_instance), r);