diff --git a/src/apple_sensors.c b/src/apple_sensors.c
index ee0bf8c09da13b2fb84fd487c0f9d906bccba6d5..bdba0ff85287745c960c1e5399d813aad2c116e2 100644 (file)
--- a/src/apple_sensors.c
+++ b/src/apple_sensors.c
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "apple_sensors");
- strcpy (vl.plugin_instance, "");
- sstrncpy (vl.type, type, sizeof (vl.type))
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "apple_sensors", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
+ sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (&vl);
if (strcmp (type, "temperature") == 0)
{
value_double = ((double) value_int) / 65536.0;
- strcpy (type, "temperature");
+ sstrncpy (type, "temperature", sizeof (type));
}
else if (strcmp (type, "temp") == 0)
{
value_double = ((double) value_int) / 10.0;
- strcpy (type, "temperature");
+ sstrncpy (type, "temperature", sizeof (type));
}
else if (strcmp (type, "fanspeed") == 0)
{
value_double = ((double) value_int) / 65536.0;
- strcpy (type, "fanspeed");
+ sstrncpy (type, "fanspeed", sizeof (type));
}
else if (strcmp (type, "voltage") == 0)
{
else if (strcmp (type, "adc") == 0)
{
value_double = ((double) value_int) / 10.0;
- strcpy (type, "fanspeed");
+ sstrncpy (type, "fanspeed", sizeof (type));
}
else
{