From 1c82ad4491c5615a133a2cdb836d9af1b64d2244 Mon Sep 17 00:00:00 2001 From: carsonzhu Date: Wed, 22 Mar 2023 16:30:49 +0800 Subject: [PATCH] make compatible for old compiler --- plugins/out_opentelemetry/opentelemetry.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/out_opentelemetry/opentelemetry.c b/plugins/out_opentelemetry/opentelemetry.c index cb52a6be44c..9235b82de5e 100644 --- a/plugins/out_opentelemetry/opentelemetry.c +++ b/plugins/out_opentelemetry/opentelemetry.c @@ -713,6 +713,7 @@ static int flush_to_otel(struct opentelemetry_context *ctx, size_t kv_index; struct mk_list *kv_head; struct flb_kv *kv; + int index; void *body; unsigned len; @@ -741,7 +742,7 @@ static int flush_to_otel(struct opentelemetry_context *ctx, flb_errno(); return -1; } - for(int index = 0; index < kv_size; index++) { + for(index = 0; index < kv_size; index++) { attributes_list[index] = &attributes[index]; } @@ -781,7 +782,7 @@ static int flush_to_otel(struct opentelemetry_context *ctx, flb_free(body); flb_free(resource_log.resource); - for (int index = 0; index < kv_size; index++) { + for (index = 0; index < kv_size; index++) { flb_free(attributes[index].value); } flb_free(attributes);