X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_tail_match.c;h=ffcaa90a118a131e7d727c46e68844670227f2e3;hb=f0d468892e1c173b226f739be48291981473b4fb;hp=604c6d4ca0ba782cd76e3e0cda717d53cb8d7883;hpb=4103105fb43cd72294f165b2541540b3a8a99532;p=collectd.git diff --git a/src/daemon/utils_tail_match.c b/src/daemon/utils_tail_match.c index 604c6d4c..ffcaa90a 100644 --- a/src/daemon/utils_tail_match.c +++ b/src/daemon/utils_tail_match.c @@ -112,9 +112,8 @@ static int tail_callback (void *data, char *buf, int __attribute__((unused)) buflen) { cu_tail_match_t *obj = (cu_tail_match_t *) data; - size_t i; - for (i = 0; i < obj->matches_num; i++) + for (size_t i = 0; i < obj->matches_num; i++) match_apply (obj->matches[i].match, buf); return (0); @@ -143,8 +142,6 @@ cu_tail_match_t *tail_match_create (const char *filename) void tail_match_destroy (cu_tail_match_t *obj) { - size_t i; - if (obj == NULL) return; @@ -154,7 +151,7 @@ void tail_match_destroy (cu_tail_match_t *obj) obj->tail = NULL; } - for (i = 0; i < obj->matches_num; i++) + for (size_t i = 0; i < obj->matches_num; i++) { cu_tail_match_match_t *match = obj->matches + i; if (match->match != NULL) @@ -247,7 +244,6 @@ int tail_match_read (cu_tail_match_t *obj) { char buffer[4096]; int status; - size_t i; status = cu_tail_read (obj->tail, buffer, sizeof (buffer), tail_callback, (void *) obj); @@ -257,7 +253,7 @@ int tail_match_read (cu_tail_match_t *obj) return (status); } - for (i = 0; i < obj->matches_num; i++) + for (size_t i = 0; i < obj->matches_num; i++) { cu_tail_match_match_t *lt_match = obj->matches + i;