int fields_num;
if (buf_len < 11)
+ {
+ ERROR ("parse_ds: (buf_len = %u) < 11", buf_len);
return (-1);
+ }
if (buf[buf_len - 1] == ',')
{
}
if (fields_num != 4)
+ {
+ ERROR ("parse_ds: (fields_num = %i) != 4", fields_num);
return (-1);
+ }
strncpy (dsrc->name, fields[0], sizeof (dsrc->name));
dsrc->name[sizeof (dsrc->name) - 1] = '\0';
else if (strcasecmp (fields[1], "COUNTER") == 0)
dsrc->type = DS_TYPE_COUNTER;
else
+ {
+ ERROR ("(fields[1] = %s) != (GAUGE || COUNTER)", fields[1]);
return (-1);
+ }
if (strcasecmp (fields[2], "U") == 0)
dsrc->min = NAN;
if (parse_ds (ds.ds + i, fields[i + 1], strlen (fields[i + 1])) != 0)
{
sfree (ds.ds);
+ ERROR ("types_list: parse_line: Cannot parse data source #%i "
+ "of data set %s", i, ds.type);
return;
}
file = global_option_get ("TypesDB");
if (file == NULL)
+ {
+ ERROR ("global_option_get (\"TypesDB\") returned NULL.");
return (-1);
+ }
fh = fopen (file, "r");
if (fh == NULL)