From: Tim Kientzle Date: Fri, 20 Nov 2015 05:07:56 +0000 (-0800) Subject: Rework to avoid some C99-isms. X-Git-Tag: v3.1.900a~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a6f23615e1ccf812ad94585acf6a3a66c719aeb;p=thirdparty%2Flibarchive.git Rework to avoid some C99-isms. --- diff --git a/libarchive/archive_write_set_format_warc.c b/libarchive/archive_write_set_format_warc.c index 80abc6f4e..a761d3526 100644 --- a/libarchive/archive_write_set_format_warc.c +++ b/libarchive/archive_write_set_format_warc.c @@ -182,6 +182,7 @@ _warc_header(struct archive_write *a, struct archive_entry *entry) { struct warc_s *w = a->format_data; struct archive_string hdr; + ssize_t r; #define MAX_HDR_SIZE 512 /* check whether warcinfo record needs outputting */ @@ -190,12 +191,13 @@ _warc_header(struct archive_write *a, struct archive_entry *entry) WT_INFO, /*uri*/NULL, /*urn*/NULL, - /*rtm*/w->now, - /*mtm*/w->now, + /*rtm*/0, + /*mtm*/0, /*cty*/"application/warc-fields", /*len*/sizeof(warcinfo) - 1U, }; - ssize_t r; + wi.rtime = w->now; + wi.mtime = w->now; archive_string_init(&hdr); r = _popul_ehdr(&hdr, MAX_HDR_SIZE, wi); @@ -226,14 +228,18 @@ _warc_header(struct archive_write *a, struct archive_entry *entry) if (w->typ == AE_IFREG) { warc_essential_hdr_t rh = { WT_RSRC, - /*uri*/archive_entry_pathname(entry), + /*uri*/NULL, /*urn*/NULL, - /*rtm*/w->now, - /*mtm*/archive_entry_mtime(entry), + /*rtm*/0, + /*mtm*/0, /*cty*/NULL, - /*len*/(size_t)archive_entry_size(entry), + /*len*/0, }; ssize_t r; + rh.tgturi = archive_entry_pathname(entry); + rh.rtime = w->now; + rh.mtime = archive_entry_mtime(entry); + rh.cntlen = (size_t)archive_entry_size(entry); archive_string_init(&hdr); r = _popul_ehdr(&hdr, MAX_HDR_SIZE, rh);