From f0330f3ccb72f985c6f5203a5ae45ac876ce4bee Mon Sep 17 00:00:00 2001 From: Bryce Gibson Date: Wed, 5 Jun 2024 13:13:11 +1000 Subject: [PATCH] config: fix compilation with FLB_HAVE_STATIC_CONF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: ``` /tmp/fluent-bit/src/config_format/flb_cf_fluentbit.c: In function ‘read_config’: /tmp/fluent-bit/src/config_format/flb_cf_fluentbit.c:505:30: error: ‘FLB_CF_BUF_SIZE’ undeclared (first use in this function); did you mean ‘FLB_CF_CUSTOM’? while (static_fgets(buf, FLB_CF_BUF_SIZE, in_data, &off)) { ^~~~~~~~~~~~~~~ ``` This applies the same change made in f50a02e41383c03d92aa15729125b587d8e7d17c when `FLB_HAVE_STATIC_CONF` is defined. Signed-off-by: Bryce Gibson --- src/config_format/flb_cf_fluentbit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config_format/flb_cf_fluentbit.c b/src/config_format/flb_cf_fluentbit.c index df77afd9c53..a680adda0dd 100644 --- a/src/config_format/flb_cf_fluentbit.c +++ b/src/config_format/flb_cf_fluentbit.c @@ -502,7 +502,7 @@ static int read_config(struct flb_cf *cf, struct local_ctx *ctx, * workaround to retrieve the lines. */ size_t off = 0; - while (static_fgets(buf, FLB_CF_BUF_SIZE, in_data, &off)) { + while (static_fgets(buf, bufsize - (fgets_ptr - buf), in_data, &off)) { #else /* normal mode, read lines into a buffer */ /* note that we use "fgets_ptr" so we can continue reading after realloc */