Skip to content

Commit

Permalink
tests: internal: fixed type that caused the comparison to fail
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Aug 27, 2024
1 parent 89f9931 commit b922052
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/internal/log_event_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b922052

Please sign in to comment.