summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-05-15 13:59:47 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-05-15 13:59:47 +0200
commit6868b56e25e6ce80418219bd876ee2de7646cf63 (patch)
tree5ae64977e22c1cae071fb8704d8af44ee4fd0add /ext/zlib/zlib.c
parent00ea48ad43122c67c904965d4c315237740685ea (diff)
downloadphp-git-6868b56e25e6ce80418219bd876ee2de7646cf63.tar.gz
Fix unrelated tests and zlib window size
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 31fe18db02..8169424362 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -827,7 +827,7 @@ PHP_FUNCTION(inflate_init)
zend_long encoding, window = 15;
char *dict = NULL;
size_t dictlen = 0;
- HashTable *options;
+ HashTable *options = NULL;
zval *option_buffer;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "l|H", &encoding, &options)) {
@@ -865,7 +865,7 @@ PHP_FUNCTION(inflate_init)
if (encoding < 0) {
encoding += 15 - window;
} else {
- encoding &= window;
+ encoding -= 15 - window;
}
if (Z_OK == inflateInit2(ctx, encoding)) {
@@ -997,7 +997,7 @@ PHP_FUNCTION(deflate_init)
zend_long encoding, level = -1, memory = 8, window = 15, strategy = Z_DEFAULT_STRATEGY;
char *dict = NULL;
size_t dictlen = 0;
- HashTable *options = 0;
+ HashTable *options = NULL;
zval *option_buffer;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "l|H", &encoding, &options)) {
@@ -1065,7 +1065,7 @@ PHP_FUNCTION(deflate_init)
if (encoding < 0) {
encoding += 15 - window;
} else {
- encoding &= window;
+ encoding -= 15 - window;
}
if (Z_OK == deflateInit2(ctx, level, Z_DEFLATED, encoding, memory, strategy)) {