diff options
author | kientzle <kientzle@FreeBSD.org> | 2005-02-12 23:11:29 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2005-02-12 23:11:29 +0000 |
commit | c17dc8430733ad21b2256ab6e159b9ba3dd1c939 (patch) | |
tree | 2d0ba3cb7160af232e27aba6846e07b900287d46 | |
parent | d7de3761218a2ccab56f7bb50b5fef9245802d90 (diff) | |
download | FreeBSD-src-c17dc8430733ad21b2256ab6e159b9ba3dd1c939.zip FreeBSD-src-c17dc8430733ad21b2256ab6e159b9ba3dd1c939.tar.gz |
Clear the error message buffer on entry to major routines.
This avoids having error messages get concatenated over multiple calls.
-rw-r--r-- | lib/libarchive/archive_write.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libarchive/archive_write.c b/lib/libarchive/archive_write.c index 76b4288..a3377db 100644 --- a/lib/libarchive/archive_write.c +++ b/lib/libarchive/archive_write.c @@ -126,6 +126,7 @@ archive_write_open(struct archive *a, void *client_data, ret = ARCHIVE_OK; archive_check_magic(a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW); + archive_string_empty(&a->error_string); a->state = ARCHIVE_STATE_HEADER; a->client_data = client_data; a->client_writer = writer; @@ -194,6 +195,7 @@ archive_write_header(struct archive *a, struct archive_entry *entry) archive_check_magic(a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA); + archive_string_empty(&a->error_string); /* Finish last entry. */ if (a->state & ARCHIVE_STATE_DATA) @@ -221,6 +223,7 @@ archive_write_data(struct archive *a, const void *buff, size_t s) { int ret; archive_check_magic(a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_DATA); + archive_string_empty(&a->error_string); ret = (a->format_write_data)(a, buff, s); return (ret == ARCHIVE_OK ? (ssize_t)s : -1); } |