summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2009-02-08 22:02:46 +0000
committerkientzle <kientzle@FreeBSD.org>2009-02-08 22:02:46 +0000
commit3bdbf535c067627d8e2cc18f2d275ad64d047437 (patch)
treedf025f3a8b5ab22722afdf6cad17495e4149e32a /usr.bin/tar
parent90862b22bb33b14bbd30c5e9dfc41da6a7686499 (diff)
downloadFreeBSD-src-3bdbf535c067627d8e2cc18f2d275ad64d047437.zip
FreeBSD-src-3bdbf535c067627d8e2cc18f2d275ad64d047437.tar.gz
When copying file data to the archive, don't write more
than was read. This seems to have only affected the shar writer, since other formats proactively truncate output to the originally-advertised size. PR: bin/131244 MFC after: 7 days
Diffstat (limited to 'usr.bin/tar')
-rw-r--r--usr.bin/tar/write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c
index 32df3a2..b14aad5 100644
--- a/usr.bin/tar/write.c
+++ b/usr.bin/tar/write.c
@@ -972,7 +972,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));
OpenPOWER on IntegriCloud