From: Brad King Date: Thu, 23 Feb 2017 12:01:25 +0000 (-0500) Subject: Avoid using C99 declaration-after-statement syntax X-Git-Tag: v3.3.1~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d49d9b913be114b66b3cc2bb90a207fc244afc2;p=thirdparty%2Flibarchive.git Avoid using C99 declaration-after-statement syntax Add a dedicated `{}` block to contain a local variable instead. --- diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c index 4e910979e..c0ca435d1 100644 --- a/libarchive/archive_write_set_format_iso9660.c +++ b/libarchive/archive_write_set_format_iso9660.c @@ -4074,8 +4074,10 @@ write_information_block(struct archive_write *a) memset(info.s, 0, info_size); opt = 0; #if defined(HAVE__CTIME64_S) - __time64_t iso9660_birth_time_tmp = (__time64_t) iso9660->birth_time; //time_t may be shorter than 64 bits - _ctime64_s(buf, sizeof(buf), &(iso9660_birth_time_tmp)); + { + __time64_t iso9660_birth_time_tmp = (__time64_t) iso9660->birth_time; //time_t may be shorter than 64 bits + _ctime64_s(buf, sizeof(buf), &(iso9660_birth_time_tmp)); + } #elif defined(HAVE_CTIME_R) ctime_r(&(iso9660->birth_time), buf); #else diff --git a/libarchive/test/test_fuzz.c b/libarchive/test/test_fuzz.c index 71bf3ffb9..ce7b8663f 100644 --- a/libarchive/test/test_fuzz.c +++ b/libarchive/test/test_fuzz.c @@ -110,8 +110,9 @@ test_fuzz(const struct files *filesets) } else { for (i = 0; filesets[n].names[i] != NULL; ++i) { + char *newraw; tmp = slurpfile(&size, filesets[n].names[i]); - char *newraw = realloc(rawimage, oldsize + size); + newraw = realloc(rawimage, oldsize + size); if (!assert(newraw != NULL)) { free(rawimage);