From: Tobias Stoeckmann Date: Tue, 3 Jun 2025 19:57:42 +0000 (+0200) Subject: warc: Ignore separator when reaching end of entry X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=cdb45d71b2857d2a9d96bbfd4b2af02ed66cb85a;p=thirdparty%2Flibarchive.git warc: Ignore separator when reaching end of entry When _warc_read encounters end of entry, it adds 4 bytes to the last offset for \r\n\r\n separator, which is never written. Ignore these bytes since they are not part of the returned entry. Signed-off-by: Tobias Stoeckmann --- diff --git a/libarchive/archive_read_support_format_warc.c b/libarchive/archive_read_support_format_warc.c index 696f959c3..d8f188cf0 100644 --- a/libarchive/archive_read_support_format_warc.c +++ b/libarchive/archive_read_support_format_warc.c @@ -405,7 +405,7 @@ _warc_read(struct archive_read *a, const void **buf, size_t *bsz, int64_t *off) /* it's our lucky day, no work, we can leave early */ *buf = NULL; *bsz = 0U; - *off = w->cntoff + 4U/*for \r\n\r\n separator*/; + *off = w->cntoff; w->unconsumed = 0U; return (ARCHIVE_EOF); }