Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'support/zlib-helper.c')
-rw-r--r--support/zlib-helper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/support/zlib-helper.c b/support/zlib-helper.c
index 5e11cb341eb..1d61c3d35fb 100644
--- a/support/zlib-helper.c
+++ b/support/zlib-helper.c
@@ -104,9 +104,11 @@ CloseZStream (ZStream *zstream)
status = 0;
if (zstream->compress) {
if (zstream->stream->total_out) {
- status = deflate (zstream->stream, Z_FINISH);
- flush_status = Flush (zstream);
- if (status == Z_OK || status == Z_STREAM_END)
+ do {
+ status = deflate (zstream->stream, Z_FINISH);
+ flush_status = Flush (zstream);
+ } while (status == Z_OK); /* We want Z_STREAM_END or error here here */
+ if (status == Z_STREAM_END)
status = flush_status;
}
deflateEnd (zstream->stream);