diff --git a/src/disk.c b/src/disk.c
index c5a0cc8555c6041b1c6519888d38a24b0e8d08ea..489770c7f9da86b9f8c0cb50d918871933c05603 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "disk");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
major = atoll (fields[0]);
minor = atoll (fields[1]);
- disk_name = fields[2];
+ disk_name = fields[2 + fieldshift];
for (ds = disklist, pre_ds = disklist; ds != NULL; pre_ds = ds, ds = ds->next)
if (strcmp (disk_name, ds->name) == 0)