summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 15e7c7f)
raw | patch | inline | side by side (parent: 15e7c7f)
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
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 a70b66589d287f4affef5003576e3583e1d55a8e..6c3d5f73f69ed788a502f928bb70f4cabcf67826 100644 (file)
--- a/src/tail_csv.c
+++ b/src/tail_csv.c
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;