From 914cf84aadaf2a893d206c69ea53a001e1c3abd3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Luis=20Sanmart=C3=ADn=20Rozada?= Date: Wed, 20 May 2015 20:37:16 +0200 Subject: [PATCH] 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 --- src/tail_csv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.11.0