Skip to content

Commit 4530987

Browse files
committed
storage: tests: internal: Fix a compilation error on CentOS 7
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent da98e04 commit 4530987

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/internal/storage_dlq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,12 @@ static int read_dlq_chunk_content(struct flb_config *ctx,
109109
static int buf_contains(const void *hay, size_t hlen,
110110
const void *needle, size_t nlen)
111111
{
112+
size_t i;
112113
if (nlen == 0 || hlen < nlen) return 0;
113114
const unsigned char *h = (const unsigned char *) hay;
114115
const unsigned char *n = (const unsigned char *) needle;
115116

116-
for (size_t i = 0; i + nlen <= hlen; i++) {
117+
for (i = 0; i + nlen <= hlen; i++) {
117118
if (h[i] == n[0] && memcmp(h + i, n, nlen) == 0) {
118119
return 1;
119120
}

0 commit comments

Comments
 (0)