From 56acff0c3794c78e1ee630a71983287a99d6fee7 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 8 Feb 2009 17:07:22 -0500 Subject: [PATCH] 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 --- tar/write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- 2.47.3