]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
From FreeBSD-CURRENT: don't write more data than we just read
authorTim Kientzle <kientzle@gmail.com>
Sun, 8 Feb 2009 22:05:39 +0000 (17:05 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sun, 8 Feb 2009 22:05:39 +0000 (17:05 -0500)
from the file.  This seems to only impact the shar writer, since
other formats proactively truncate the output.

SVN-Revision: 588

tar/write.c

index 026ef1779a207a99e3acf1477eda0938ed178e21..153c114419bff5d037887896b500307e5606f864 100644 (file)
@@ -936,7 +936,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));