vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
int status;
/* Send request */
- snprintf (command, sizeof (command), "sel %i\r\n", vserver->port);
- command[sizeof (command) - 1] = 0;
+ ssnprintf (command, sizeof (command), "sel %i\r\n", vserver->port);
status = tss2_send_request (write_fh, command);
if (status != 0)
ERROR ("teamspeak2 plugin: tss2_receive_line failed.");
return (-1);
}
- response[sizeof (response)] = 0;
+ response[sizeof (response) - 1] = 0;
/* Check answer */
if ((strncasecmp ("OK", response, 2) == 0)
} /* int tss2_select_vserver */
static int tss2_vserver_gapl (FILE *read_fh, FILE *write_fh,
- vserver_list_t *vserver, gauge_t *ret_value)
+ gauge_t *ret_value)
{
/*
* Reads the vserver's average packet loss and submits it to collectd.
ERROR ("teamspeak2 plugin: tss2_receive_line failed.");
return (-1);
}
- buffer[sizeof (buffer)] = 0;
+ buffer[sizeof (buffer) - 1] = 0;
if (strncmp ("average_packet_loss=", buffer,
strlen ("average_packet_loss=")) == 0)
else
{
/* Request server information */
- snprintf (plugin_instance, sizeof (plugin_instance), "vserver%i",
+ ssnprintf (plugin_instance, sizeof (plugin_instance), "vserver%i",
vserver->port);
- plugin_instance[sizeof (plugin_instance) - 1] = 0;
/* Select the server */
status = tss2_select_vserver (read_fh, write_fh, vserver);
* with an error. */
if ((status == 0) && (vserver != NULL))
{
- status = tss2_vserver_gapl (read_fh, write_fh, vserver, &packet_loss);
+ status = tss2_vserver_gapl (read_fh, write_fh, &packet_loss);
if (status == 0)
{
valid |= 0x20;