summaryrefslogtreecommitdiff
path: root/libarchive/archive_write_set_format_cpio.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@gmail.com>2010-04-17 21:20:13 -0400
committerTim Kientzle <kientzle@gmail.com>2010-04-17 21:20:13 -0400
commit9dc6eec37c2f71cd5a9e2fc680c90f2ce73530fd (patch)
tree7fea4f33d561e74d30352482968276bb0e65bb11 /libarchive/archive_write_set_format_cpio.c
parent5e8e019bb1abc71529aa37f0cf86d73d8db68101 (diff)
downloadlibarchive-9dc6eec37c2f71cd5a9e2fc680c90f2ce73530fd.tar.gz
Introduce a shared __archive_write_nulls() method and remove
the duplicate copies of this function. SVN-Revision: 2262
Diffstat (limited to 'libarchive/archive_write_set_format_cpio.c')
-rw-r--r--libarchive/archive_write_set_format_cpio.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/libarchive/archive_write_set_format_cpio.c b/libarchive/archive_write_set_format_cpio.c
index 8cbef96a..1339f4f2 100644
--- a/libarchive/archive_write_set_format_cpio.c
+++ b/libarchive/archive_write_set_format_cpio.c
@@ -328,18 +328,7 @@ static int
archive_write_cpio_finish_entry(struct archive_write *a)
{
struct cpio *cpio;
- size_t to_write;
- int ret;
cpio = (struct cpio *)a->format_data;
- ret = ARCHIVE_OK;
- while (cpio->entry_bytes_remaining > 0) {
- to_write = cpio->entry_bytes_remaining < a->null_length ?
- cpio->entry_bytes_remaining : a->null_length;
- ret = __archive_write_output(a, a->nulls, to_write);
- if (ret != ARCHIVE_OK)
- return (ret);
- cpio->entry_bytes_remaining -= to_write;
- }
- return (ret);
+ return (__archive_write_nulls(a, cpio->entry_bytes_remaining));
}