projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c6bbc09
)
Replace all occurrences of `strcpy' with `sstrncpy'.
author
Florian Forster
<sifnfors@informatik.stud.uni-erlangen.de>
Wed, 11 Jun 2008 12:29:31 +0000
(14:29 +0200)
committer
Florian Forster
<sifnfors@informatik.stud.uni-erlangen.de>
Wed, 11 Jun 2008 12:29:31 +0000
(14:29 +0200)
43 files changed:
src/apache.c
patch
|
blob
|
history
src/apcups.c
patch
|
blob
|
history
src/apple_sensors.c
patch
|
blob
|
history
src/battery.c
patch
|
blob
|
history
src/cpu.c
patch
|
blob
|
history
src/cpufreq.c
patch
|
blob
|
history
src/df.c
patch
|
blob
|
history
src/disk.c
patch
|
blob
|
history
src/dns.c
patch
|
blob
|
history
src/email.c
patch
|
blob
|
history
src/entropy.c
patch
|
blob
|
history
src/hddtemp.c
patch
|
blob
|
history
src/interface.c
patch
|
blob
|
history
src/iptables.c
patch
|
blob
|
history
src/ipvs.c
patch
|
blob
|
history
src/irq.c
patch
|
blob
|
history
src/load.c
patch
|
blob
|
history
src/mbmon.c
patch
|
blob
|
history
src/memcached.c
patch
|
blob
|
history
src/memory.c
patch
|
blob
|
history
src/multimeter.c
patch
|
blob
|
history
src/mysql.c
patch
|
blob
|
history
src/netlink.c
patch
|
blob
|
history
src/network.c
patch
|
blob
|
history
src/nfs.c
patch
|
blob
|
history
src/nginx.c
patch
|
blob
|
history
src/ntpd.c
patch
|
blob
|
history
src/nut.c
patch
|
blob
|
history
src/perl.c
patch
|
blob
|
history
src/ping.c
patch
|
blob
|
history
src/processes.c
patch
|
blob
|
history
src/rrdtool.c
patch
|
blob
|
history
src/serial.c
patch
|
blob
|
history
src/snmp.c
patch
|
blob
|
history
src/swap.c
patch
|
blob
|
history
src/tape.c
patch
|
blob
|
history
src/tcpconns.c
patch
|
blob
|
history
src/users.c
patch
|
blob
|
history
src/utils_cmd_putval.c
patch
|
blob
|
history
src/utils_dns.c
patch
|
blob
|
history
src/vserver.c
patch
|
blob
|
history
src/wireless.c
patch
|
blob
|
history
src/xmms.c
patch
|
blob
|
history
diff --git
a/src/apache.c
b/src/apache.c
index
2a7e0b8
..
54a5d56
100644
(file)
--- a/
src/apache.c
+++ b/
src/apache.c
@@
-173,9
+173,9
@@
static void submit_counter (const char *type, const char *type_instance,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "apache"
);
- s
trcpy (vl.plugin_instance, ""
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "apache", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
if (type_instance != NULL)
{
if (type_instance != NULL)
{
@@
-198,9
+198,9
@@
static void submit_gauge (const char *type, const char *type_instance,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "apache"
);
- s
trcpy (vl.plugin_instance, ""
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "apache", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
if (type_instance != NULL)
{
if (type_instance != NULL)
{
diff --git
a/src/apcups.c
b/src/apcups.c
index
5a03764
..
c948f5a
100644
(file)
--- a/
src/apcups.c
+++ b/
src/apcups.c
@@
-373,9
+373,9
@@
static void apc_submit_generic (char *type, char *type_inst, double value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "apcups"
);
- s
trcpy (vl.plugin_instance, ""
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "apcups", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
diff --git
a/src/apple_sensors.c
b/src/apple_sensors.c
index
2726ad2
..
5e957b6
100644
(file)
--- a/
src/apple_sensors.c
+++ b/
src/apple_sensors.c
@@
-88,10
+88,10
@@
static void as_submit (const char *type, const char *type_instance,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "apple_sensors"
);
- s
trcpy (vl.plugin_instance, ""
);
- s
trcpy (vl.type_instance, type_instance
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "apple_sensors", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
+ s
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)
);
plugin_dispatch_values (type, &vl);
}
plugin_dispatch_values (type, &vl);
}
@@
-192,17
+192,17
@@
static int as_read (void)
if (strcmp (type, "temperature") == 0)
{
value_double = ((double) value_int) / 65536.0;
if (strcmp (type, "temperature") == 0)
{
value_double = ((double) value_int) / 65536.0;
- s
trcpy (type, "temperature"
);
+ s
strncpy (type, "temperature", sizeof (type)
);
}
else if (strcmp (type, "temp") == 0)
{
value_double = ((double) value_int) / 10.0;
}
else if (strcmp (type, "temp") == 0)
{
value_double = ((double) value_int) / 10.0;
- s
trcpy (type, "temperature"
);
+ s
strncpy (type, "temperature", sizeof (type)
);
}
else if (strcmp (type, "fanspeed") == 0)
{
value_double = ((double) value_int) / 65536.0;
}
else if (strcmp (type, "fanspeed") == 0)
{
value_double = ((double) value_int) / 65536.0;
- s
trcpy (type, "fanspeed"
);
+ s
strncpy (type, "fanspeed", sizeof (type)
);
}
else if (strcmp (type, "voltage") == 0)
{
}
else if (strcmp (type, "voltage") == 0)
{
@@
-212,7
+212,7
@@
static int as_read (void)
else if (strcmp (type, "adc") == 0)
{
value_double = ((double) value_int) / 10.0;
else if (strcmp (type, "adc") == 0)
{
value_double = ((double) value_int) / 10.0;
- s
trcpy (type, "fanspeed"
);
+ s
strncpy (type, "fanspeed", sizeof (type)
);
}
else
{
}
else
{
diff --git
a/src/battery.c
b/src/battery.c
index
345f606
..
badd8e7
100644
(file)
--- a/
src/battery.c
+++ b/
src/battery.c
@@
-98,9
+98,9
@@
static void battery_submit (const char *plugin_instance, const char *type, doubl
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "battery"
);
- s
trcpy (vl.plugin_instance, plugin_instance
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "battery", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)
);
plugin_dispatch_values (type, &vl);
} /* void battery_submit */
plugin_dispatch_values (type, &vl);
} /* void battery_submit */
diff --git
a/src/cpu.c
b/src/cpu.c
index
c79c4b6
..
0daebcc
100644
(file)
--- a/
src/cpu.c
+++ b/
src/cpu.c
@@
-167,12
+167,12
@@
static void submit (int cpu_num, const char *type_instance, counter_t value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "cpu"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "cpu", sizeof (vl.plugin)
);
snprintf (vl.plugin_instance, sizeof (vl.type_instance),
"%i", cpu_num);
vl.plugin_instance[DATA_MAX_NAME_LEN - 1] = '\0';
snprintf (vl.plugin_instance, sizeof (vl.type_instance),
"%i", cpu_num);
vl.plugin_instance[DATA_MAX_NAME_LEN - 1] = '\0';
- s
trcpy (vl.type_instance, type_instance
);
+ s
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)
);
plugin_dispatch_values ("cpu", &vl);
}
plugin_dispatch_values ("cpu", &vl);
}
diff --git
a/src/cpufreq.c
b/src/cpufreq.c
index
42248a9
..
74e542b
100644
(file)
--- a/
src/cpufreq.c
+++ b/
src/cpufreq.c
@@
-68,8
+68,8
@@
static void cpufreq_submit (int cpu_num, double value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "cpufreq"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "cpufreq", sizeof (vl.plugin)
);
snprintf (vl.type_instance, sizeof (vl.type_instance),
"%i", cpu_num);
snprintf (vl.type_instance, sizeof (vl.type_instance),
"%i", cpu_num);
diff --git
a/src/df.c
b/src/df.c
index
0f357d8
..
6bd9250
100644
(file)
--- a/
src/df.c
+++ b/
src/df.c
@@
-125,9
+125,9
@@
static void df_submit (char *df_name,
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "df"
);
- s
trcpy (vl.plugin_instance, ""
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "df", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
strncpy (vl.type_instance, df_name, sizeof (vl.type_instance));
plugin_dispatch_values ("df", &vl);
strncpy (vl.type_instance, df_name, sizeof (vl.type_instance));
plugin_dispatch_values ("df", &vl);
diff --git
a/src/disk.c
b/src/disk.c
index
e7372ab
..
536c511
100644
(file)
--- a/
src/disk.c
+++ b/
src/disk.c
@@
-164,8
+164,8
@@
static void disk_submit (const char *plugin_instance,
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "disk"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "disk", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git
a/src/dns.c
b/src/dns.c
index
e9996b9
..
69cb192
100644
(file)
--- a/
src/dns.c
+++ b/
src/dns.c
@@
-299,8
+299,8
@@
static void submit_counter (const char *type, const char *type_instance,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "dns"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "dns", sizeof (vl.plugin)
);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
@@
-317,8
+317,8
@@
static void submit_octets (counter_t queries, counter_t responses)
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "dns"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "dns", sizeof (vl.plugin)
);
plugin_dispatch_values ("dns_octets", &vl);
} /* void submit_counter */
plugin_dispatch_values ("dns_octets", &vl);
} /* void submit_counter */
diff --git
a/src/email.c
b/src/email.c
index
869b7c3
..
b718cf5
100644
(file)
--- a/
src/email.c
+++ b/
src/email.c
@@
-733,8
+733,8
@@
static void email_submit (const char *type, const char *type_instance, gauge_t v
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "email"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "email", sizeof (vl.plugin)
);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
diff --git
a/src/entropy.c
b/src/entropy.c
index
5f9eb53
..
69ce314
100644
(file)
--- a/
src/entropy.c
+++ b/
src/entropy.c
@@
-39,10
+39,10
@@
static void entropy_submit (double entropy)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "entropy"
);
- s
trcpy (vl.plugin_instance, ""
);
- s
trcpy (vl.type_instance, ""
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "entropy", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
+ s
strncpy (vl.type_instance, "", sizeof (vl.type_instance)
);
plugin_dispatch_values ("entropy", &vl);
}
plugin_dispatch_values ("entropy", &vl);
}
diff --git
a/src/hddtemp.c
b/src/hddtemp.c
index
36ada53
..
cb49577
100644
(file)
--- a/
src/hddtemp.c
+++ b/
src/hddtemp.c
@@
-449,8
+449,8
@@
static void hddtemp_submit (char *type_instance, double value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "hddtemp"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "hddtemp", sizeof (vl.plugin)
);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values ("temperature", &vl);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values ("temperature", &vl);
diff --git
a/src/interface.c
b/src/interface.c
index
33736b6
..
2add89d
100644
(file)
--- a/
src/interface.c
+++ b/
src/interface.c
@@
-197,8
+197,8
@@
static void if_submit (const char *dev, const char *type,
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "interface"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "interface", sizeof (vl.plugin)
);
strncpy (vl.type_instance, dev, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
strncpy (vl.type_instance, dev, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
diff --git
a/src/iptables.c
b/src/iptables.c
index
72b4481
..
6522a55
100644
(file)
--- a/
src/iptables.c
+++ b/
src/iptables.c
@@
-219,8
+219,8
@@
static int submit_match (const struct ipt_entry_match *match,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "iptables"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "iptables", sizeof (vl.plugin)
);
status = snprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%s-%s", chain->table, chain->chain);
status = snprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%s-%s", chain->table, chain->chain);
diff --git
a/src/ipvs.c
b/src/ipvs.c
index
68a3d7f
..
31e9741
100644
(file)
--- a/
src/ipvs.c
+++ b/
src/ipvs.c
@@
-238,10
+238,10
@@
static void cipvs_submit_connections (char *pi, char *ti, counter_t value)
vl.time = time (NULL);
vl.interval = interval_g;
vl.time = time (NULL);
vl.interval = interval_g;
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "ipvs"
);
- s
trcpy (vl.plugin_instance, pi
);
- s
trcpy (vl.type_instance, (NULL != ti) ? ti : "total"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "ipvs", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, pi, sizeof (vl.plugin_instance)
);
+ s
strncpy (vl.type_instance, (NULL != ti) ? ti : "total", sizeof (vl.type_instance)
);
plugin_dispatch_values ("connections", &vl);
return;
plugin_dispatch_values ("connections", &vl);
return;
@@
-262,10
+262,10
@@
static void cipvs_submit_if (char *pi, char *t, char *ti,
vl.time = time (NULL);
vl.interval = interval_g;
vl.time = time (NULL);
vl.interval = interval_g;
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "ipvs"
);
- s
trcpy (vl.plugin_instance, pi
);
- s
trcpy (vl.type_instance, (NULL != ti) ? ti : "total"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "ipvs", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, pi, sizeof (vl.plugin_instance)
);
+ s
strncpy (vl.type_instance, (NULL != ti) ? ti : "total", sizeof (vl.type_instance)
);
plugin_dispatch_values (t, &vl);
return;
plugin_dispatch_values (t, &vl);
return;
diff --git
a/src/irq.c
b/src/irq.c
index
9eb1de4
..
93c6076
100644
(file)
--- a/
src/irq.c
+++ b/
src/irq.c
@@
-132,8
+132,8
@@
static void irq_submit (unsigned int irq, counter_t value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "irq"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "irq", sizeof (vl.plugin)
);
status = snprintf (vl.type_instance, sizeof (vl.type_instance),
"%u", irq);
status = snprintf (vl.type_instance, sizeof (vl.type_instance),
"%u", irq);
diff --git
a/src/load.c
b/src/load.c
index
15215d3
..
e0e0c0e
100644
(file)
--- a/
src/load.c
+++ b/
src/load.c
@@
-51,8
+51,8
@@
static void load_submit (gauge_t snum, gauge_t mnum, gauge_t lnum)
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "load"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "load", sizeof (vl.plugin)
);
plugin_dispatch_values ("load", &vl);
}
plugin_dispatch_values ("load", &vl);
}
diff --git
a/src/mbmon.c
b/src/mbmon.c
index
50d7363
..
22a26da
100644
(file)
--- a/
src/mbmon.c
+++ b/
src/mbmon.c
@@
-228,8
+228,8
@@
static void mbmon_submit (const char *type, const char *type_instance,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "mbmon"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "mbmon", sizeof (vl.plugin)
);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
diff --git
a/src/memcached.c
b/src/memcached.c
index
a182578
..
c830598
100644
(file)
--- a/
src/memcached.c
+++ b/
src/memcached.c
@@
-224,8
+224,8
@@
static void submit_counter (const char *type, const char *type_inst,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "memcached"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "memcached", sizeof (vl.plugin)
);
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
@@
-248,8
+248,8
@@
static void submit_counter2 (const char *type, const char *type_inst,
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "memcached"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "memcached", sizeof (vl.plugin)
);
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
@@
-271,8
+271,8
@@
static void submit_gauge (const char *type, const char *type_inst,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "memcached"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "memcached", sizeof (vl.plugin)
);
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
@@
-295,8
+295,8
@@
static void submit_gauge2 (const char *type, const char *type_inst,
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "memcached"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "memcached", sizeof (vl.plugin)
);
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
diff --git
a/src/memory.c
b/src/memory.c
index
fe3a16e
..
583f71a
100644
(file)
--- a/
src/memory.c
+++ b/
src/memory.c
@@
-109,8
+109,8
@@
static void memory_submit (const char *type_instance, gauge_t value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "memory"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "memory", sizeof (vl.plugin)
);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
diff --git
a/src/multimeter.c
b/src/multimeter.c
index
11ca42c
..
c6b070a
100644
(file)
--- a/
src/multimeter.c
+++ b/
src/multimeter.c
@@
-216,8
+216,8
@@
static void multimeter_submit (double value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "multimeter"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "multimeter", sizeof (vl.plugin)
);
plugin_dispatch_values ("multimeter", &vl);
}
plugin_dispatch_values ("multimeter", &vl);
}
diff --git
a/src/mysql.c
b/src/mysql.c
index
d472853
..
aa585d6
100644
(file)
--- a/
src/mysql.c
+++ b/
src/mysql.c
@@
-126,8
+126,8
@@
static void counter_submit (const char *type, const char *type_instance,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "mysql"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "mysql", sizeof (vl.plugin)
);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
@@
-149,8
+149,8
@@
static void qcache_submit (counter_t hits, counter_t inserts,
vl.values = values;
vl.values_len = 5;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 5;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "mysql"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "mysql", sizeof (vl.plugin)
);
plugin_dispatch_values ("mysql_qcache", &vl);
} /* void qcache_submit */
plugin_dispatch_values ("mysql_qcache", &vl);
} /* void qcache_submit */
@@
-169,8
+169,8
@@
static void threads_submit (gauge_t running, gauge_t connected, gauge_t cached,
vl.values = values;
vl.values_len = 4;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 4;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "mysql"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "mysql", sizeof (vl.plugin)
);
plugin_dispatch_values ("mysql_threads", &vl);
} /* void threads_submit */
plugin_dispatch_values ("mysql_threads", &vl);
} /* void threads_submit */
@@
-186,8
+186,8
@@
static void traffic_submit (counter_t rx, counter_t tx)
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "mysql"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "mysql", sizeof (vl.plugin)
);
plugin_dispatch_values ("mysql_octets", &vl);
} /* void traffic_submit */
plugin_dispatch_values ("mysql_octets", &vl);
} /* void traffic_submit */
diff --git
a/src/netlink.c
b/src/netlink.c
index
22afdc7
..
e54365d
100644
(file)
--- a/
src/netlink.c
+++ b/
src/netlink.c
@@
-171,8
+171,8
@@
static void submit_one (const char *dev, const char *type,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "netlink"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "netlink", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
if (type_instance != NULL)
strncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
if (type_instance != NULL)
@@
-194,8
+194,8
@@
static void submit_two (const char *dev, const char *type,
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "netlink"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "netlink", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
if (type_instance != NULL)
strncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
if (type_instance != NULL)
diff --git
a/src/network.c
b/src/network.c
index
ff806af
..
022e46a
100644
(file)
--- a/
src/network.c
+++ b/
src/network.c
@@
-1405,7
+1405,7
@@
static int add_to_buffer (char *buffer, int buffer_size,
if (write_part_string (&buffer, &buffer_size, TYPE_HOST,
vl->host, strlen (vl->host)) != 0)
return (-1);
if (write_part_string (&buffer, &buffer_size, TYPE_HOST,
vl->host, strlen (vl->host)) != 0)
return (-1);
- s
trcpy (vl_def->host, vl->host
);
+ s
strncpy (vl_def->host, vl->host, sizeof (vl_def->host)
);
}
if (vl_def->time != vl->time)
}
if (vl_def->time != vl->time)
@@
-1429,7
+1429,7
@@
static int add_to_buffer (char *buffer, int buffer_size,
if (write_part_string (&buffer, &buffer_size, TYPE_PLUGIN,
vl->plugin, strlen (vl->plugin)) != 0)
return (-1);
if (write_part_string (&buffer, &buffer_size, TYPE_PLUGIN,
vl->plugin, strlen (vl->plugin)) != 0)
return (-1);
- s
trcpy (vl_def->plugin, vl->plugin
);
+ s
strncpy (vl_def->plugin, vl->plugin, sizeof (vl_def->plugin)
);
}
if (strcmp (vl_def->plugin_instance, vl->plugin_instance) != 0)
}
if (strcmp (vl_def->plugin_instance, vl->plugin_instance) != 0)
@@
-1438,7
+1438,7
@@
static int add_to_buffer (char *buffer, int buffer_size,
vl->plugin_instance,
strlen (vl->plugin_instance)) != 0)
return (-1);
vl->plugin_instance,
strlen (vl->plugin_instance)) != 0)
return (-1);
- s
trcpy (vl_def->plugin_instance, vl->plugin_instance
);
+ s
strncpy (vl_def->plugin_instance, vl->plugin_instance, sizeof (vl_def->plugin_instance)
);
}
if (strcmp (type_def, ds->type) != 0)
}
if (strcmp (type_def, ds->type) != 0)
@@
-1446,7
+1446,7
@@
static int add_to_buffer (char *buffer, int buffer_size,
if (write_part_string (&buffer, &buffer_size, TYPE_TYPE,
ds->type, strlen (ds->type)) != 0)
return (-1);
if (write_part_string (&buffer, &buffer_size, TYPE_TYPE,
ds->type, strlen (ds->type)) != 0)
return (-1);
- s
trcpy (type_def, ds->type
);
+ s
strncpy (type_def, ds->type, sizeof (type_def)
);
}
if (strcmp (vl_def->type_instance, vl->type_instance) != 0)
}
if (strcmp (vl_def->type_instance, vl->type_instance) != 0)
@@
-1455,7
+1455,7
@@
static int add_to_buffer (char *buffer, int buffer_size,
vl->type_instance,
strlen (vl->type_instance)) != 0)
return (-1);
vl->type_instance,
strlen (vl->type_instance)) != 0)
return (-1);
- s
trcpy (vl_def->type_instance, vl->type_instance
);
+ s
strncpy (vl_def->type_instance, vl->type_instance, sizeof (vl_def->type_instance)
);
}
if (write_part_values (&buffer, &buffer_size, ds, vl) != 0)
}
if (write_part_values (&buffer, &buffer_size, ds, vl) != 0)
diff --git
a/src/nfs.c
b/src/nfs.c
index
77c7f48
..
91e6788
100644
(file)
--- a/
src/nfs.c
+++ b/
src/nfs.c
@@
-188,8
+188,8
@@
static void nfs_procedures_submit (const char *plugin_instance,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "nfs"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "nfs", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git
a/src/nginx.c
b/src/nginx.c
index
0e3b843
..
a5201a0
100644
(file)
--- a/
src/nginx.c
+++ b/
src/nginx.c
@@
-151,9
+151,9
@@
static void submit (char *type, char *inst, long long value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "nginx"
);
- s
trcpy (vl.plugin_instance, ""
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "nginx", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
if (inst != NULL)
{
if (inst != NULL)
{
diff --git
a/src/ntpd.c
b/src/ntpd.c
index
90fdfd7
..
ff0a48d
100644
(file)
--- a/
src/ntpd.c
+++ b/
src/ntpd.c
@@
-302,9
+302,9
@@
static void ntpd_submit (char *type, char *type_inst, double value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "ntpd"
);
- s
trcpy (vl.plugin_instance, ""
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "ntpd", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
diff --git
a/src/nut.c
b/src/nut.c
index
f7f026a
..
695d93b
100644
(file)
--- a/
src/nut.c
+++ b/
src/nut.c
@@
-129,7
+129,7
@@
static void nut_submit (nut_ups_t *ups, const char *type,
? hostname_g
: ups->hostname,
sizeof (vl.host));
? hostname_g
: ups->hostname,
sizeof (vl.host));
- s
trcpy (vl.plugin, "nut"
);
+ s
strncpy (vl.plugin, "nut", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, ups->upsname, sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
strncpy (vl.plugin_instance, ups->upsname, sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git
a/src/perl.c
b/src/perl.c
index
877bc00
..
22a13ce
100644
(file)
--- a/
src/perl.c
+++ b/
src/perl.c
@@
-553,7
+553,7
@@
static int pplugin_dispatch_values (pTHX_ char *name, HV *values)
list.host[DATA_MAX_NAME_LEN - 1] = '\0';
}
else {
list.host[DATA_MAX_NAME_LEN - 1] = '\0';
}
else {
- s
trcpy (list.host, hostname_g
);
+ s
strncpy (list.host, hostname_g, sizeof (list.host)
);
}
if (NULL != (tmp = hv_fetch (values, "plugin", 6, 0))) {
}
if (NULL != (tmp = hv_fetch (values, "plugin", 6, 0))) {
diff --git
a/src/ping.c
b/src/ping.c
index
2f7c064
..
09de77c
100644
(file)
--- a/
src/ping.c
+++ b/
src/ping.c
@@
-186,9
+186,9
@@
static void ping_submit (char *host, double latency)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "ping"
);
- s
trcpy (vl.plugin_instance, ""
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "ping", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
strncpy (vl.type_instance, host, sizeof (vl.type_instance));
plugin_dispatch_values ("ping", &vl);
strncpy (vl.type_instance, host, sizeof (vl.type_instance));
plugin_dispatch_values ("ping", &vl);
diff --git
a/src/processes.c
b/src/processes.c
index
22d369d
..
6ad4681
100644
(file)
--- a/
src/processes.c
+++ b/
src/processes.c
@@
-409,9
+409,9
@@
static void ps_submit_state (const char *state, double value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "processes"
);
- s
trcpy (vl.plugin_instance, ""
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "processes", sizeof (vl.plugin)
);
+ s
strncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)
);
strncpy (vl.type_instance, state, sizeof (vl.type_instance));
plugin_dispatch_values ("ps_state", &vl);
strncpy (vl.type_instance, state, sizeof (vl.type_instance));
plugin_dispatch_values ("ps_state", &vl);
@@
-425,8
+425,8
@@
static void ps_submit_proc_list (procstat_t *ps)
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "processes"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "processes", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, ps->name, sizeof (vl.plugin_instance));
vl.values[0].gauge = ps->vmem_rss;
strncpy (vl.plugin_instance, ps->name, sizeof (vl.plugin_instance));
vl.values[0].gauge = ps->vmem_rss;
diff --git
a/src/rrdtool.c
b/src/rrdtool.c
index
3bb5a9e
..
adf6eeb
100644
(file)
--- a/
src/rrdtool.c
+++ b/
src/rrdtool.c
@@
-285,7
+285,7
@@
static int ds_get (char ***ret, const data_set_t *ds, const value_list_t *vl)
if (isnan (d->min))
{
if (isnan (d->min))
{
- s
trcpy (min, "U"
);
+ s
strncpy (min, "U", sizeof (min)
);
}
else
{
}
else
{
@@
-295,7
+295,7
@@
static int ds_get (char ***ret, const data_set_t *ds, const value_list_t *vl)
if (isnan (d->max))
{
if (isnan (d->max))
{
- s
trcpy (max, "U"
);
+ s
strncpy (max, "U", sizeof (max)
);
}
else
{
}
else
{
diff --git
a/src/serial.c
b/src/serial.c
index
9cfe1dd
..
4f08a34
100644
(file)
--- a/
src/serial.c
+++ b/
src/serial.c
@@
-41,8
+41,8
@@
static void serial_submit (const char *type_instance,
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "serial"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "serial", sizeof (vl.plugin)
);
strncpy (vl.type_instance, type_instance,
sizeof (vl.type_instance));
strncpy (vl.type_instance, type_instance,
sizeof (vl.type_instance));
diff --git
a/src/snmp.c
b/src/snmp.c
index
4311ff1
..
6788ea9
100644
(file)
--- a/
src/snmp.c
+++ b/
src/snmp.c
@@
-909,7
+909,7
@@
static int csnmp_dispatch_table (host_definition_t *host, data_definition_t *dat
strncpy (vl.host, host->name, sizeof (vl.host));
vl.host[sizeof (vl.host) - 1] = '\0';
strncpy (vl.host, host->name, sizeof (vl.host));
vl.host[sizeof (vl.host) - 1] = '\0';
- s
trcpy (vl.plugin, "snmp"
);
+ s
strncpy (vl.plugin, "snmp", sizeof (vl.plugin)
);
vl.interval = host->interval;
vl.time = time (NULL);
vl.interval = host->interval;
vl.time = time (NULL);
@@
-1301,7
+1301,7
@@
static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
strncpy (vl.host, host->name, sizeof (vl.host));
vl.host[sizeof (vl.host) - 1] = '\0';
strncpy (vl.host, host->name, sizeof (vl.host));
vl.host[sizeof (vl.host) - 1] = '\0';
- s
trcpy (vl.plugin, "snmp"
);
+ s
strncpy (vl.plugin, "snmp", sizeof (vl.plugin)
);
strncpy (vl.type_instance, data->instance.string, sizeof (vl.type_instance));
vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
strncpy (vl.type_instance, data->instance.string, sizeof (vl.type_instance));
vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
diff --git
a/src/swap.c
b/src/swap.c
index
e91ebef
..
4d1f24d
100644
(file)
--- a/
src/swap.c
+++ b/
src/swap.c
@@
-124,8
+124,8
@@
static void swap_submit (const char *type_instance, double value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "swap"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "swap", sizeof (vl.plugin)
);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values ("swap", &vl);
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values ("swap", &vl);
diff --git
a/src/tape.c
b/src/tape.c
index
465688e
..
5b5cdb4
100644
(file)
--- a/
src/tape.c
+++ b/
src/tape.c
@@
-69,8
+69,8
@@
static void tape_submit (const char *plugin_instance,
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "tape"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "tape", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git
a/src/tcpconns.c
b/src/tcpconns.c
index
fdf7ec1
..
5a8f461
100644
(file)
--- a/
src/tcpconns.c
+++ b/
src/tcpconns.c
@@
-135,8
+135,8
@@
static void conn_submit_port_entry (port_entry_t *pe)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "tcpconns"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "tcpconns", sizeof (vl.plugin)
);
if (((port_collect_listening != 0) && (pe->flags & PORT_IS_LISTENING))
|| (pe->flags & PORT_COLLECT_LOCAL))
if (((port_collect_listening != 0) && (pe->flags & PORT_IS_LISTENING))
|| (pe->flags & PORT_COLLECT_LOCAL))
diff --git
a/src/users.c
b/src/users.c
index
afe26e1
..
5e6a0b5
100644
(file)
--- a/
src/users.c
+++ b/
src/users.c
@@
-45,8
+45,8
@@
static void users_submit (gauge_t value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "users"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "users", sizeof (vl.plugin)
);
plugin_dispatch_values ("users", &vl);
} /* void users_submit */
plugin_dispatch_values ("users", &vl);
} /* void users_submit */
diff --git
a/src/utils_cmd_putval.c
b/src/utils_cmd_putval.c
index
98b5043
..
e5f7495
100644
(file)
--- a/
src/utils_cmd_putval.c
+++ b/
src/utils_cmd_putval.c
@@
-166,12
+166,12
@@
int handle_putval (FILE *fh, char **fields, int fields_num)
return (-1);
}
return (-1);
}
- s
trcpy (vl.host, hostname
);
- s
trcpy (vl.plugin, plugin
);
+ s
strncpy (vl.host, hostname, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, plugin, sizeof (vl.plugin)
);
if (plugin_instance != NULL)
if (plugin_instance != NULL)
- s
trcpy (vl.plugin_instance, plugin_instance
);
+ s
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)
);
if (type_instance != NULL)
if (type_instance != NULL)
- s
trcpy (vl.type_instance, type_instance
);
+ s
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)
);
ds = plugin_get_ds (type);
if (ds == NULL) {
ds = plugin_get_ds (type);
if (ds == NULL) {
diff --git
a/src/utils_dns.c
b/src/utils_dns.c
index
25ef189
..
3f5d4fb
100644
(file)
--- a/
src/utils_dns.c
+++ b/
src/utils_dns.c
@@
-384,7
+384,7
@@
handle_dns(const char *buf, int len,
if (0 != x)
return 0;
if ('\0' == qh.qname[0])
if (0 != x)
return 0;
if ('\0' == qh.qname[0])
- str
cpy(qh.qname, "."
);
+ str
ncpy (qh.qname, ".", sizeof (qh.qname)
);
while ((t = strchr(qh.qname, '\n')))
*t = ' ';
while ((t = strchr(qh.qname, '\r')))
while ((t = strchr(qh.qname, '\n')))
*t = ' ';
while ((t = strchr(qh.qname, '\r')))
diff --git
a/src/vserver.c
b/src/vserver.c
index
7b83c61
..
5484344
100644
(file)
--- a/
src/vserver.c
+++ b/
src/vserver.c
@@
-57,8
+57,8
@@
static void traffic_submit (const char *plugin_instance,
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "vserver"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "vserver", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
@@
-78,8
+78,8
@@
static void load_submit (const char *plugin_instance,
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "vserver"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "vserver", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
plugin_dispatch_values ("load", &vl);
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
plugin_dispatch_values ("load", &vl);
@@
-97,8
+97,8
@@
static void submit_gauge (const char *plugin_instance, const char *type,
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "vserver"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "vserver", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git
a/src/wireless.c
b/src/wireless.c
index
fdea9d3
..
0edaf45
100644
(file)
--- a/
src/wireless.c
+++ b/
src/wireless.c
@@
-56,8
+56,8
@@
static void wireless_submit (const char *plugin_instance, const char *type,
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "wireless"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "wireless", sizeof (vl.plugin)
);
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git
a/src/xmms.c
b/src/xmms.c
index
1e646d2
..
7f3edf0
100644
(file)
--- a/
src/xmms.c
+++ b/
src/xmms.c
@@
-37,8
+37,8
@@
static void cxmms_submit (const char *type, gauge_t value)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- s
trcpy (vl.host, hostname_g
);
- s
trcpy (vl.plugin, "xmms"
);
+ s
strncpy (vl.host, hostname_g, sizeof (vl.host)
);
+ s
strncpy (vl.plugin, "xmms", sizeof (vl.plugin)
);
plugin_dispatch_values (type, &vl);
} /* void cxmms_submit */
plugin_dispatch_values (type, &vl);
} /* void cxmms_submit */