projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tree wide: Don't set vl.host to hostname_g in plugin code.
[collectd.git]
/
src
/
teamspeak2.c
diff --git
a/src/teamspeak2.c
b/src/teamspeak2.c
index
a1cde32
..
1bd969b
100644
(file)
--- a/
src/teamspeak2.c
+++ b/
src/teamspeak2.c
@@
-121,14
+121,10
@@
static void tss2_submit_gauge (const char *plugin_instance,
/*
* Submits a gauge value to the collectd daemon
*/
/*
* Submits a gauge value to the collectd daemon
*/
- value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
value_list_t vl = VALUE_LIST_INIT;
- values[0].gauge = value;
-
- vl.values = values;
+ vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
if (plugin_instance != NULL)
@@
-150,15
+146,14
@@
static void tss2_submit_io (const char *plugin_instance, const char *type,
/*
* Submits the io rx/tx tuple to the collectd daemon
*/
/*
* Submits the io rx/tx tuple to the collectd daemon
*/
- value_t values[2];
value_list_t vl = VALUE_LIST_INIT;
value_list_t vl = VALUE_LIST_INIT;
-
- values[0].derive = rx;
- values[1].derive = tx;
+ value_t values[] = {
+ { .derive = rx },
+ { .derive = tx },
+ };
vl.values = values;
vl.values = values;
- vl.values_len = 2;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ vl.values_len = STATIC_ARRAY_SIZE (values);
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
if (plugin_instance != NULL)