X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Finterface.c;h=806a336dfde09c814c9ab9f204e5770758251893;hb=2c2e9a297f59c110ddd4adef6293fe80f39f15b7;hp=ef758bc8b374bf507e60c630dc72702a1e26858f;hpb=5f9ec13b946733ff4e1edf2d8e3b7a22311dd894;p=collectd.git diff --git a/src/interface.c b/src/interface.c index ef758bc8..806a336d 100644 --- a/src/interface.c +++ b/src/interface.c @@ -46,6 +46,10 @@ # include #endif +#if HAVE_STATGRAB_H +# include +#endif + /* * Various people have reported problems with `getifaddrs' and varying versions * of `glibc'. That's why it's disabled by default. Since more statistics are @@ -193,8 +197,8 @@ static void if_submit (const char *dev, const char *type, vl.values = values; vl.values_len = 2; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "interface"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "interface", sizeof (vl.plugin)); sstrncpy (vl.type, type, sizeof (vl.type)); sstrncpy (vl.type_instance, dev, sizeof (vl.type_instance));