From: Manuel Luis SanmartĂ­n Rozada Date: Wed, 20 May 2015 18:37:16 +0000 (+0200) Subject: Plugin tail_csv: if TimeFrom is not specified in config file X-Git-Tag: collectd-5.5.1~116^2~14 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=914cf84aadaf2a893d206c69ea53a001e1c3abd3;p=collectd.git Plugin tail_csv: if TimeFrom is not specified in config file the default value for time_from is -1 and the type of fileds_num is size_t, so the comparsion of signed and unsigned not work as espected --- diff --git a/src/tail_csv.c b/src/tail_csv.c index a70b6658..6c3d5f73 100644 --- a/src/tail_csv.c +++ b/src/tail_csv.c @@ -106,7 +106,10 @@ static int tcsv_read_metric (instance_definition_t *id, if (md->data_source_type == -1) return (EINVAL); - if ((md->value_from >= fields_num) || (id->time_from >= fields_num)) + if (md->value_from >= fields_num) + return (EINVAL); + + if (id->time_from >= 0 && (id->time_from >= fields_num)) return (EINVAL); t = 0;