From: Tim Kientzle Date: Sun, 8 Feb 2009 22:07:22 +0000 (-0500) Subject: Merge r588 from trunk: Don't write more data than was read. X-Git-Tag: v2.6.2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56acff0c3794c78e1ee630a71983287a99d6fee7;p=thirdparty%2Flibarchive.git Merge r588 from trunk: Don't write more data than was read. In particular, this causes bsdtar to write garbage data after entries in shar archives. Other output formats seem unaffected by this gaffe. SVN-Revision: 589 --- diff --git a/tar/write.c b/tar/write.c index 9cc7200cb..07297225c 100644 --- a/tar/write.c +++ b/tar/write.c @@ -973,7 +973,7 @@ write_file_data(struct bsdtar *bsdtar, struct archive *a, siginfo_printinfo(bsdtar, progress); bytes_written = archive_write_data(a, bsdtar->buff, - FILEDATABUFLEN); + bytes_read); if (bytes_written < 0) { /* Write failed; this is bad */ bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));