diff mbox series

[v2,6/7] fixup! reftable: reftable file level tests

Message ID 20210816011538.34199-7-carenas@gmail.com (mailing list archive)
State New, archived
Headers show
Series hn/reftable "fixes" for BSD | expand

Commit Message

Carlo Marcelo Arenas Belón Aug. 16, 2021, 1:15 a.m. UTC
C99 style loop initializers still problematic with gnu89 C in older
compilers.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 reftable/readwrite_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/reftable/readwrite_test.c b/reftable/readwrite_test.c
index 42ca48f83c..146b00cb02 100644
--- a/reftable/readwrite_test.c
+++ b/reftable/readwrite_test.c
@@ -120,7 +120,7 @@  static void test_log_buffer_size(void)
 	struct reftable_write_options opts = {
 		.block_size = 4096,
 	};
-	int err;
+	int err, i;
 	struct reftable_log_record log = { .refname = "refs/heads/master",
 					   .update_index = 0xa,
 					   .value_type = REFTABLE_LOG_UPDATE,
@@ -138,7 +138,7 @@  static void test_log_buffer_size(void)
 	   hash, to ensure that the compressed part is larger than the original.
 	*/
 	uint8_t hash1[GIT_SHA1_RAWSZ], hash2[GIT_SHA1_RAWSZ];
-	for (int i = 0; i < GIT_SHA1_RAWSZ; i++) {
+	for (i = 0; i < GIT_SHA1_RAWSZ; i++) {
 		hash1[i] = (uint8_t)(rand() % 256);
 		hash2[i] = (uint8_t)(rand() % 256);
 	}