com php-src: Fix unrelated tests and zlib window size: ext/zlib/tests/inflate_init_error.phpt ext/zlib/zlib. c
| From: | Bob Weinand | Date: | Fri, 15 May 2015 11:59:47 +0000 |
| Subject: | com php-src: Fix unrelated tests and zlib window size: ext/zlib/tests/inflate_init_error.phpt ext/zlib/zlib. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86778@lists.php.net to get a copy of this message | ||
Commit: 6868b56e25e6ce80418219bd876ee2de7646cf63
Author: Bob Weinand <bobwei9@hotmail.com> Fri, 15 May 2015 13:59:47 +0200
Parents: 00ea48ad43122c67c904965d4c315237740685ea
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6868b56e25e6ce80418219bd876ee2de7646cf63
Log:
Fix unrelated tests and zlib window size
Changed paths:
M ext/zlib/tests/inflate_init_error.phpt
M ext/zlib/zlib.c
Diff:
diff --git a/ext/zlib/tests/inflate_init_error.phpt b/ext/zlib/tests/inflate_init_error.phpt
index 0e0e8b3..58c07a4 100644
--- a/ext/zlib/tests/inflate_init_error.phpt
+++ b/ext/zlib/tests/inflate_init_error.phpt
@@ -13,7 +13,7 @@ var_dump(inflate_init(42));
?>
--EXPECTF--
-Warning: inflate_init() expects exactly 1 parameter, 0 given in %s on line %d
+Warning: inflate_init() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: inflate_init(): encoding mode must be ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or
ZLIB_ENCODING_DEFLATE in %s on line %d
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 31fe18d..8169424 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)) {