]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix C90 build errors 683/head
authorNate Rosenblum <natr@google.com>
Wed, 13 Apr 2016 23:14:02 +0000 (16:14 -0700)
committerNate Rosenblum <natr@google.com>
Wed, 13 Apr 2016 23:17:47 +0000 (16:17 -0700)
libarchive/archive_read_support_format_mtree.c
libarchive/test/main.c

index 2b8cca7e558030088f2098a4ef2d5c8d01807627..81d96521138e4c976d41fcfc82115a767e7559ae 100644 (file)
@@ -857,7 +857,7 @@ process_add_entry(struct archive_read *a, struct mtree *mtree,
        struct mtree_option *iter;
        const char *next, *eq, *name, *end;
        size_t name_len, len;
-       int r;
+       int r, i;
 
        if ((entry = malloc(sizeof(*entry))) == NULL) {
                archive_set_error(&a->archive, errno, "Can't allocate memory");
@@ -892,7 +892,7 @@ process_add_entry(struct archive_read *a, struct mtree *mtree,
                }
                /* Name starts after the last whitespace separator */
                name = line;
-               for (int i = 0; i < line_len; i++) {
+               for (i = 0; i < line_len; i++) {
                        if (line[i] == '\r'
                            || line[i] == '\n'
                            || line[i] == '\t'
index 88d72b311f9fb9484dccfe852926e4e63c0ac607..f9ca55d60c2652f2d91dcc97ac42909cae385a34 100644 (file)
@@ -789,10 +789,11 @@ assertion_memory_filled_with(const char *file, int line,
        const char *v1 = (const char *)_v1;
        size_t c = 0;
        (void)ld; /* UNUSED */
+       size_t i;
 
        assertion_count(file, line);
 
-       for (size_t i = 0; i < l; ++i) {
+       for (i = 0; i < l; ++i) {
                if (v1[i] == b) {
                        ++c;
                }