]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge r588 from trunk: Don't write more data than was read.
authorTim Kientzle <kientzle@gmail.com>
Sun, 8 Feb 2009 22:07:22 +0000 (17:07 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sun, 8 Feb 2009 22:07:22 +0000 (17:07 -0500)
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

tar/write.c

index 9cc7200cb30eb1a583b9761f82ca851903eec499..07297225c99f6859b52f909160de15d2b1252e98 100644 (file)
@@ -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));