From: Florian Forster Date: Wed, 11 Jun 2008 12:32:19 +0000 (+0200) Subject: Replace all occurrences of `strcpy' with `sstrncpy', again. X-Git-Tag: collectd-4.4.2~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f1a13745491b03b5f7379b12abf866f8ff50d608;p=collectd.git Replace all occurrences of `strcpy' with `sstrncpy', again. This changes all files that are new in 4.4. --- diff --git a/src/ascent.c b/src/ascent.c index 94691d6b..8c0bbec6 100644 --- a/src/ascent.c +++ b/src/ascent.c @@ -123,8 +123,8 @@ static int ascent_submit_gauge (const char *plugin_instance, /* {{{ */ vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "ascent"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "ascent", sizeof (vl.plugin)); if (plugin_instance != NULL) sstrncpy (vl.plugin_instance, plugin_instance, diff --git a/src/powerdns.c b/src/powerdns.c index 51e39ee2..644dd56b 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -619,7 +619,7 @@ static int powerdns_update_recursor_command (list_item_t *li) /* {{{ */ } else { - strcpy (buffer, "get "); + sstrncpy (buffer, "get ", sizeof (buffer)); status = strjoin (&buffer[4], sizeof (buffer) - strlen ("get "), li->fields, li->fields_num, /* seperator = */ " "); diff --git a/src/vmem.c b/src/vmem.c index e0f76e76..5341e159 100644 --- a/src/vmem.c +++ b/src/vmem.c @@ -46,8 +46,8 @@ static void submit (const char *plugin_instance, const char *type, vl.values_len = values_len; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "vmem"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "vmem", sizeof (vl.plugin)); if (plugin_instance != NULL) sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); if (type_instance != NULL)