X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapcups.c;h=ca026b9689907f49f7227c3ae612b54e4ff4cfef;hb=074b4980bc75bea6826e6a38dcc6e193a721b2a8;hp=fb481092c18108dbed8d3be09fb41e6655457e26;hpb=47faf00c18402cefd0e195d63ad48d5e7e6a4a92;p=collectd.git diff --git a/src/apcups.c b/src/apcups.c index fb481092..ca026b96 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -24,13 +24,6 @@ * Anthony Gialluca **/ -/* - * FIXME: Don't know why but without this here atof() was not returning - * correct values for me. This is behavior that I don't understand and - * should be examined in closer detail. - */ -#include - #include "collectd.h" #include "common.h" /* rrd_update_file */ #include "plugin.h" /* plugin_register, plugin_submit */ @@ -372,9 +365,9 @@ static void apc_submit_generic (char *type, char *type_inst, double value) vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "apcups"); - strcpy (vl.plugin_instance, ""); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "apcups", sizeof (vl.plugin)); + sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)); sstrncpy (vl.type, type, sizeof (vl.type)); sstrncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));