projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15e7c7f
)
Plugin tail_csv: if TimeFrom is not specified in config file
author
Manuel Luis SanmartĂn Rozada
<manuel.luis@gmail.com>
Wed, 20 May 2015 18:37:16 +0000
(20:37 +0200)
committer
Florian Forster
<octo@collectd.org>
Sun, 31 May 2015 20:42:16 +0000
(22:42 +0200)
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
patch
|
blob
|
history
diff --git
a/src/tail_csv.c
b/src/tail_csv.c
index
a70b665
..
6c3d5f7
100644
(file)
--- 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;