Skip to content

Commit 9a77a40

Browse files
committed
Fix bad merge
1 parent 7cc8a93 commit 9a77a40

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
@@ -257,6 +257,7 @@ PHP_FUNCTION(pack)
257257

258258
case 'a':
259259
case 'A':
260+
case 'Z':
260261
case 'c':
261262
case 'C':
262263
case 'x':
@@ -322,7 +323,9 @@ PHP_FUNCTION(pack)
322323
switch ((int) code) {
323324
case 'a':
324325
case 'A':
325-
memset(&output[outputpos], (code == 'a') ? '\0' : ' ', arg);
326+
case 'Z': {
327+
int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1);
328+
memset(&output[outputpos], (code == 'a' || code == 'Z') ? '\0' : ' ', arg);
326329
val = argv[currentarg++];
327330
if (Z_ISREF_PP(val)) {
328331
SEPARATE_ZVAL(val);

0 commit comments

Comments
 (0)