From 8e1265666839a7f1985f81ab5949747387a09aa9 Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Fri, 23 Aug 2024 12:56:36 +0200 Subject: [PATCH] tests: internal: fixed type that caused the comparison to fail Signed-off-by: Leonardo Alminana --- tests/internal/log_event_encoder.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/internal/log_event_encoder.c b/tests/internal/log_event_encoder.c index 99f67eb2777..1ee09bccdcc 100644 --- a/tests/internal/log_event_encoder.c +++ b/tests/internal/log_event_encoder.c @@ -656,6 +656,7 @@ static void emit_raw_record() */ static void timestamp_encoding() { + uint8_t *encoder_buffer; struct flb_time timestamp; struct flb_log_event_encoder encoder; int result; @@ -707,13 +708,15 @@ static void timestamp_encoding() return; } + encoder_buffer = (uint8_t *) encoder.output_buffer; + result = FLB_FALSE; for (index = 0 ; index < encoder.output_length - 4 ; index++) { - if (encoder.output_buffer[index + 0] == 0x00 && - encoder.output_buffer[index + 1] == 0xC0 && - encoder.output_buffer[index + 2] == 0xFF && - encoder.output_buffer[index + 3] == 0xEE) { + if (encoder_buffer[index + 0] == 0x00 && + encoder_buffer[index + 1] == 0xC0 && + encoder_buffer[index + 2] == 0xFF && + encoder_buffer[index + 3] == 0xEE) { result = FLB_TRUE; break;