projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
configure.in: Check for `mysql_get_server_version' in libmyql.
[collectd.git]
/
src
/
xmms.c
diff --git
a/src/xmms.c
b/src/xmms.c
index
238a8ee
..
09786fc
100644
(file)
--- 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);
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)
} /* 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))
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);
cxmms_submit ("bitrate", rate);
cxmms_submit ("frequency", freq);