X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Finterface.c;h=8947dd61c0160b8c833e48a872e6dd69c93c6664;hb=2b65cef7870c385b9b56b34701ced62528f3f7c0;hp=741ff764bd576f4ee45f5ea2d5ffb0cea14c8477;hpb=6d3dc246eb6ce32214825f909541cf7cbd441948;p=collectd.git diff --git a/src/interface.c b/src/interface.c index 741ff764..8947dd61 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1,6 +1,6 @@ /** * collectd - src/interface.c - * Copyright (C) 2005-2007 Florian octo Forster + * Copyright (C) 2005-2008 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -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,11 +197,12 @@ 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"); - strncpy (vl.type_instance, dev, sizeof (vl.type_instance)); + 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)); - plugin_dispatch_values (type, &vl); + plugin_dispatch_values (&vl); } /* void if_submit */ static int interface_read (void)