From 2a6f23615e1ccf812ad94585acf6a3a66c719aeb Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Thu, 19 Nov 2015 21:07:56 -0800 Subject: [PATCH] Rework to avoid some C99-isms. --- libarchive/archive_write_set_format_warc.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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); -- 2.47.2