diff options
Diffstat (limited to 'ext/standard/pack.c')
-rw-r--r-- | ext/standard/pack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 4af72c34b8..85709bc9f1 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -560,7 +560,7 @@ PHP_FUNCTION(unpack) { char *format, *input; zend_string *formatarg, *inputarg; - size_t formatlen, inputpos, inputlen; + zend_long formatlen, inputpos, inputlen; int i; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &formatarg, @@ -717,7 +717,7 @@ PHP_FUNCTION(unpack) inputpos = 0; } - if ((size >=0 && (inputpos + size) <= inputlen) || (size < 0 && -size <= (inputlen - inputpos))) { + if ((inputpos + size) <= inputlen) { switch ((int) type) { case 'a': { /* a will not strip any trailing whitespace or null padding */ |