X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fteamspeak2.c;h=345f57e0d6a5c534fe57d3a946cd6555e95f9e72;hb=d13a04dc3645a21acecc14a4174837766ecb6a2b;hp=2552ad305ffcaa51decb9ab490764a1cc907e4fb;hpb=9b967a770f38099336c3652986d93c8b4d610a36;p=collectd.git diff --git a/src/teamspeak2.c b/src/teamspeak2.c index 2552ad30..345f57e0 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -18,7 +18,7 @@ * * Authors: * Stefan Hacker - * Florian Forster + * Florian Forster **/ #include "collectd.h" @@ -28,7 +28,6 @@ #include #include #include -#include #include /* @@ -84,7 +83,7 @@ static int tss2_add_vserver (int vserver_port) } /* Allocate memory */ - entry = (vserver_list_t *) malloc (sizeof (vserver_list_t)); + entry = malloc (sizeof (*entry)); if (entry == NULL) { ERROR ("teamspeak2 plugin: malloc failed."); @@ -258,6 +257,7 @@ static int tss2_get_socket (FILE **ret_read_fh, FILE **ret_write_fh) WARNING ("teamspeak2 plugin: connect failed: %s", sstrerror (errno, errbuf, sizeof (errbuf))); close (sd); + sd = -1; continue; } @@ -439,7 +439,7 @@ static int tss2_vserver_gapl (FILE *read_fh, FILE *write_fh, status = tss2_receive_line (read_fh, buffer, sizeof (buffer)); if (status != 0) { - /* Set to NULL just to make sure noone uses these FHs anymore. */ + /* Set to NULL just to make sure no one uses these FHs anymore. */ read_fh = NULL; write_fh = NULL; ERROR ("teamspeak2 plugin: tss2_receive_line failed."); @@ -564,7 +564,7 @@ static int tss2_read_vserver (vserver_list_t *vserver) status = tss2_receive_line (read_fh, buffer, sizeof (buffer)); if (status != 0) { - /* Set to NULL just to make sure noone uses these FHs anymore. */ + /* Set to NULL just to make sure no one uses these FHs anymore. */ read_fh = NULL; write_fh = NULL; ERROR ("teamspeak2 plugin: tss2_receive_line failed.");