Skip to content

Commit 70bfc45

Browse files
committed
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fix bad merge
2 parents bb00ddd + 9a77a40 commit 70bfc45

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/standard/pack.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ PHP_FUNCTION(pack)
275275

276276
case 'a':
277277
case 'A':
278+
case 'Z':
278279
case 'c':
279280
case 'C':
280281
case 'x':
@@ -349,7 +350,9 @@ PHP_FUNCTION(pack)
349350
switch ((int) code) {
350351
case 'a':
351352
case 'A':
352-
memset(&output[outputpos], (code == 'a') ? '\0' : ' ', arg);
353+
case 'Z': {
354+
int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1);
355+
memset(&output[outputpos], (code == 'a' || code == 'Z') ? '\0' : ' ', arg);
353356
val = argv[currentarg++];
354357
if (Z_ISREF_PP(val)) {
355358
SEPARATE_ZVAL(val);

0 commit comments

Comments
 (0)