summaryrefslogtreecommitdiff
path: root/compress.c
diff options
context:
space:
mode:
Diffstat (limited to 'compress.c')
-rw-r--r--compress.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/compress.c b/compress.c
index 8edcb2a..762a9df 100644
--- a/compress.c
+++ b/compress.c
@@ -3,7 +3,7 @@
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
6/* $Id: compress.c,v 1.4 1995/04/10 15:52:04 jloup Exp $ */ 6/* $Id: compress.c,v 1.5 1995/04/29 17:18:43 jloup Exp $ */
7 7
8#include "zlib.h" 8#include "zlib.h"
9 9
@@ -44,9 +44,9 @@ int compress (dest, destLen, source, sourceLen)
44 if (err != Z_OK) return err; 44 if (err != Z_OK) return err;
45 45
46 err = deflate(&stream, Z_FINISH); 46 err = deflate(&stream, Z_FINISH);
47 if (err != Z_OK) { 47 if (err != Z_STREAM_END) {
48 deflateEnd(&stream); 48 deflateEnd(&stream);
49 return err; 49 return err == Z_OK ? Z_BUF_ERROR : err;
50 } 50 }
51 *destLen = stream.total_out; 51 *destLen = stream.total_out;
52 52