src/utils_cmd_flush.c: Fix parsing of the "timeout" option.
[collectd.git] / src / xmms.c
index 238a8ee..52beb65 100644 (file)
@@ -36,11 +36,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 +55,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);