From f1a13745491b03b5f7379b12abf866f8ff50d608 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 11 Jun 2008 14:32:19 +0200 Subject: [PATCH] Replace all occurrences of `strcpy' with `sstrncpy', again. This changes all files that are new in 4.4. --- src/ascent.c | 4 ++-- src/powerdns.c | 2 +- src/vmem.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) 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) -- 2.30.2