X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fnetapp.c;h=c532062645b97b2292df079e9fbd2150eb75efa0;hb=604607d3463fbe13eac252308f8a2497fb190167;hp=f238a6d0e82a4dd296a13c91e930eb80d6f55feb;hpb=e14e8b7f5c5bf9d0fe5cc632c6383f304d4ac2ad;p=collectd.git diff --git a/src/netapp.c b/src/netapp.c index f238a6d0..c5320626 100644 --- a/src/netapp.c +++ b/src/netapp.c @@ -633,8 +633,6 @@ static int submit_values (const char *host, /* {{{ */ if (host != NULL) sstrncpy (vl.host, host, sizeof (vl.host)); - else - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "netapp", sizeof (vl.plugin)); if (plugin_inst != NULL) sstrncpy (vl.plugin_instance, plugin_inst, sizeof (vl.plugin_instance)); @@ -649,13 +647,13 @@ static int submit_two_derive (const char *host, const char *plugin_inst, /* {{{ const char *type, const char *type_inst, derive_t val0, derive_t val1, cdtime_t timestamp, cdtime_t interval) { - value_t values[2]; - - values[0].derive = val0; - values[1].derive = val1; + value_t values[] = { + { .derive = val0 }, + { .derive = val1 }, + }; return (submit_values (host, plugin_inst, type, type_inst, - values, 2, timestamp, interval)); + values, STATIC_ARRAY_SIZE (values), timestamp, interval)); } /* }}} int submit_two_derive */ static int submit_derive (const char *host, const char *plugin_inst, /* {{{ */ @@ -670,13 +668,13 @@ static int submit_two_gauge (const char *host, const char *plugin_inst, /* {{{ * const char *type, const char *type_inst, gauge_t val0, gauge_t val1, cdtime_t timestamp, cdtime_t interval) { - value_t values[2]; - - values[0].gauge = val0; - values[1].gauge = val1; + value_t values[] = { + { .gauge = val0 }, + { .gauge = val1 }, + }; return (submit_values (host, plugin_inst, type, type_inst, - values, 2, timestamp, interval)); + values, STATIC_ARRAY_SIZE (values), timestamp, interval)); } /* }}} int submit_two_gauge */ static int submit_double (const char *host, const char *plugin_inst, /* {{{ */