summaryrefslogtreecommitdiff
path: root/libarchive/archive_write_add_filter_compress.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@gmail.com>2010-10-31 02:24:18 -0400
committerTim Kientzle <kientzle@gmail.com>2010-10-31 02:24:18 -0400
commitd2cdb00e25c8f52f160576c5c4267744449ec4c6 (patch)
treed3211b181fd59e580b0f4d86559b0cf770fbbab3 /libarchive/archive_write_add_filter_compress.c
parent8f7907399dd99274d292a9e08ef860c2a217725f (diff)
downloadlibarchive-d2cdb00e25c8f52f160576c5c4267744449ec4c6.tar.gz
__archive_write_filter returns a status, not a count of bytes written.
Correct the bzip2 and compress writers. SVN-Revision: 2773
Diffstat (limited to 'libarchive/archive_write_add_filter_compress.c')
-rw-r--r--libarchive/archive_write_add_filter_compress.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libarchive/archive_write_add_filter_compress.c b/libarchive/archive_write_add_filter_compress.c
index 25a08a8d..f8e6258e 100644
--- a/libarchive/archive_write_add_filter_compress.c
+++ b/libarchive/archive_write_add_filter_compress.c
@@ -222,15 +222,14 @@ static int
output_byte(struct archive_write_filter *f, unsigned char c)
{
struct private_data *state = f->data;
- ssize_t bytes_written;
state->compressed[state->compressed_offset++] = c;
++state->out_count;
if (state->compressed_buffer_size == state->compressed_offset) {
- bytes_written = __archive_write_filter(f->next_filter,
+ int ret = __archive_write_filter(f->next_filter,
state->compressed, state->compressed_buffer_size);
- if (bytes_written <= 0)
+ if (ret != ARCHIVE_OK)
return ARCHIVE_FATAL;
state->compressed_offset = 0;
}