From: Tim Kientzle Date: Sun, 8 Feb 2009 22:05:39 +0000 (-0500) Subject: From FreeBSD-CURRENT: don't write more data than we just read X-Git-Tag: v2.7.0~315 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceac2932dd8a3d774171209deb16c2893a028663;p=thirdparty%2Flibarchive.git From FreeBSD-CURRENT: don't write more data than we just read from the file. This seems to only impact the shar writer, since other formats proactively truncate the output. SVN-Revision: 588 --- diff --git a/tar/write.c b/tar/write.c index 026ef1779..153c11441 100644 --- a/tar/write.c +++ b/tar/write.c @@ -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));