diff --git a/src/cpufreq.c b/src/cpufreq.c
index f4424e6556af254d556a9b902be012fc8ff5ad83..1e9e857980c68c3ebcb19af9e9b8c15d3f83ddcc 100644 (file)
--- a/src/cpufreq.c
+++ b/src/cpufreq.c
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "cpufreq");
- strcpy (vl.type, "cpufreq");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "cpufreq", sizeof (vl.plugin));
+ sstrncpy (vl.type, "cpufreq", sizeof (vl.type));
ssnprintf (vl.type_instance, sizeof (vl.type_instance),
"%i", cpu_num);
{
int status;
unsigned long long val;
- int i = 0;
FILE *fp;
char filename[256];
char buffer[16];
- for (i = 0; i < num_cpu; i++)
+ for (int i = 0; i < num_cpu; i++)
{
status = ssnprintf (filename, sizeof (filename),
"/sys/devices/system/cpu/cpu%d/cpufreq/"