X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fxmms.c;h=09786fc9282b6f01bd8568750b771e4f8df039ea;hb=654783aed1fab02766a9cc036e859799e01f6f9e;hp=238a8ee3bf5e639dc0dd0718e49683b1448716af;hpb=63cbff115ba03717e81087d1419fc07c24d205c2;p=collectd.git diff --git a/src/xmms.c b/src/xmms.c index 238a8ee3..09786fc9 100644 --- a/src/xmms.c +++ b/src/xmms.c @@ -37,10 +37,11 @@ static void cxmms_submit (const char *type, gauge_t value) vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "xmms"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "xmms", sizeof (vl.plugin)); + sstrncpy (vl.type, type, sizeof (vl.type)); - plugin_dispatch_values (type, &vl); + plugin_dispatch_values (&vl); } /* void cxmms_submit */ int cxmms_read (void) @@ -55,7 +56,7 @@ int cxmms_read (void) xmms_remote_get_info (xmms_session, &rate, &freq, &nch); if ((freq == 0) || (nch == 0)) - return (0); + return (-1); cxmms_submit ("bitrate", rate); cxmms_submit ("frequency", freq);