X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fping.c;h=70a83730c3c2f05617ffdeae5de50ec6e3eab2d2;hb=068ae14b916aa298995433da83302032c5e57c76;hp=20388c370d4801f52a33e1b0c823a6bdea04ac11;hpb=c28bc580c110c78741d0805c7652e05d994b0ff4;p=collectd.git diff --git a/src/ping.c b/src/ping.c index 20388c37..70a83730 100644 --- a/src/ping.c +++ b/src/ping.c @@ -1,6 +1,6 @@ /** * collectd - src/ping.c - * Copyright (C) 2005,2006 Florian octo Forster + * Copyright (C) 2005-2007 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 @@ -186,11 +186,11 @@ static void ping_submit (char *host, double latency) vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "ping"); - strcpy (vl.plugin_instance, ""); - strcpy (vl.type, "ping"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "ping", sizeof (vl.plugin)); + sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)); sstrncpy (vl.type_instance, host, sizeof (vl.type_instance)); + sstrncpy (vl.type, "ping", sizeof (vl.type)); plugin_dispatch_values (&vl); }