X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbattery.c;h=9f1bee654e014812f254070a458f2be5a60508d3;hb=10075e6fe3c384b73c2dd398a1435f8d10e56654;hp=74b3344a1e28e494861d45d3732d335c1b82fcf4;hpb=17019425b82a8f0c925b90a7638678b1b3b71a25;p=collectd.git diff --git a/src/battery.c b/src/battery.c index 74b3344a..9f1bee65 100644 --- a/src/battery.c +++ b/src/battery.c @@ -99,8 +99,8 @@ static void battery_submit (const char *plugin_instance, const char *type, doubl vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "battery"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "battery", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); sstrncpy (vl.type, type, sizeof (vl.type));