diff --git a/src/csv.c b/src/csv.c
index ff59f91c006e81511b6aeec738000398ed945bdc..b5de302eefd4c21ce8c6e26a4b2d306fcd7889f4 100644 (file)
--- a/src/csv.c
+++ b/src/csv.c
int i;
gauge_t *rates = NULL;
+ assert (0 == strcmp (ds->type, vl->type));
+
memset (buffer, '\0', buffer_len);
status = snprintf (buffer, buffer_len, "%u", (unsigned int) vl->time);
int offset = 0;
int status;
+ assert (0 == strcmp (ds->type, vl->type));
+
if (datadir != NULL)
{
status = snprintf (buffer + offset, buffer_len - offset,
if (strlen (vl->type_instance) > 0)
status = snprintf (buffer + offset, buffer_len - offset,
- "%s-%s", ds->type, vl->type_instance);
+ "%s-%s", vl->type, vl->type_instance);
else
status = snprintf (buffer + offset, buffer_len - offset,
- "%s", ds->type);
+ "%s", vl->type);
if ((status < 1) || (status >= buffer_len - offset))
return (-1);
offset += status;
struct flock fl;
int status;
+ if (0 != strcmp (ds->type, vl->type)) {
+ ERROR ("csv plugin: DS type does not match value list type");
+ return -1;
+ }
+
if (value_list_to_filename (filename, sizeof (filename), ds, vl) != 0)
return (-1);