]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fixed build error in test_read_format_zip_high_compression.c 751/head
authoraahancoc <aahancoc@umflint.edu>
Tue, 26 Jul 2016 20:03:54 +0000 (16:03 -0400)
committerGitHub <noreply@github.com>
Tue, 26 Jul 2016 20:03:54 +0000 (16:03 -0400)
C89 (what this library is compiled in) requires for loop iterators to be initialized outside the for loop.

libarchive/test/test_read_format_zip_high_compression.c

index 79c923a9067b7baf08421983f1f632a594af602f..6c8aa8eee1b2adfae11edca8f136fa1cf4161dba 100644 (file)
@@ -80,6 +80,7 @@ DEFINE_TEST(test_read_format_zip_high_compression2)
        const size_t body_size = 1024 * 1024;
        const size_t buff_size = 2 * 1024 * 1024;
        char *body, *body_read, *buff;
+       int n;
 
        assert((body = malloc(body_size)) != NULL);
        assert((body_read = malloc(body_size)) != NULL);
@@ -91,7 +92,7 @@ DEFINE_TEST(test_read_format_zip_high_compression2)
         * buffer is exactly 256k).
         */
 
-       for(int n = 1024; n < (int)body_size; n += 1024) {
+       for(n = 1024; n < (int)body_size; n += 1024) {
                struct archive *a;
                struct archive_entry *entry;
                size_t used = 0;