X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fapcups.c;h=462006a66a2a9447738ad60c060c2a3451c6e60f;hb=a019b6c8144745db63c599680bd693ac02f11666;hp=5a03764f59f5ea53bc1ac63cd549f183d22e40d1;hpb=4fb5d4b471e3f6a24d7cd36272e48e57bcb2c68f;p=collectd.git diff --git a/src/apcups.c b/src/apcups.c index 5a03764f..462006a6 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 */ @@ -373,9 +366,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)); strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance)); plugin_dispatch_values (type, &vl);