]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Minigzip: Set compression level to default when compiling without ZLIB_COMPAT.
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 12 May 2015 20:22:03 +0000 (22:22 +0200)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 12 May 2015 20:22:03 +0000 (22:22 +0200)
(level is available in mode[2], needs to be parsed)

test/minigzip.c

index 8fb028803dabcb3adbd8fff02c5c5fe8eff4b74d..4ba062ef8e6464e546462b4257741b67efc312cb 100644 (file)
@@ -100,6 +100,7 @@ gzFile gz_open(const char *path, int fd, const char *mode)
 {
     gzFile gz;
     int ret;
+    int level = Z_DEFAULT_COMPRESSION;
 
     gz = malloc(sizeof(struct gzFile_s));
     if (gz == NULL)
@@ -109,7 +110,7 @@ gzFile gz_open(const char *path, int fd, const char *mode)
     gz->strm.zfree = myfree;
     gz->strm.opaque = Z_NULL;
     if (gz->write)
-        ret = deflateInit2(&(gz->strm), -1, 8, 15 + 16, 8, 0);
+        ret = deflateInit2(&(gz->strm), level, 8, 15 + 16, 8, 0);
     else {
         gz->strm.next_in = 0;
         gz->strm.avail_in = Z_NULL;