com php-src: Backport some printf() fixes to 7.2: ext/opcache/ZendAccelerator.c ext/phar/phar_object.c ext/ standard/exec.c
| From: | Nikita Popov | Date: | Thu, 16 Nov 2017 20:26:33 +0000 |
| Subject: | com php-src: Backport some printf() fixes to 7.2: ext/opcache/ZendAccelerator.c ext/phar/phar_object.c ext/ standard/exec.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100282@lists.php.net to get a copy of this message | ||
Commit: 95e9cc28717c4051d552d6da2ef120f203bc2dd3
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 16 Nov 2017 21:26:33 +0100
Parents: 9379b319b0e9922c097f0b41dff83007ba4e7b3c
Branches: PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=95e9cc28717c4051d552d6da2ef120f203bc2dd3
Log:
Backport some printf() fixes to 7.2
Changed paths:
M ext/opcache/ZendAccelerator.c
M ext/phar/phar_object.c
M ext/standard/exec.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 6d18ea1..d9d5940 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2185,7 +2185,7 @@ static void accel_activate(void)
if (ZCG(counted)) {
#ifdef ZTS
- zend_accel_error(ACCEL_LOG_WARNING, "Stuck count for thread id %d", tsrm_thread_id());
+ zend_accel_error(ACCEL_LOG_WARNING, "Stuck count for thread id %lu", (unsigned long)
tsrm_thread_id());
#else
zend_accel_error(ACCEL_LOG_WARNING, "Stuck count for pid %d", getpid());
#endif
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index c310203..876d5da 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -1481,7 +1481,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
if (ZEND_SIZE_T_INT_OVFL(Z_STRLEN(key))) {
zval_dtor(&key);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an
invalid key (too long)", ZSTR_VAL(ce->name));
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an
invalid key (too long)", ZSTR_VAL(ce->name));
return ZEND_HASH_APPLY_STOP;
}
@@ -1615,7 +1615,7 @@ phar_spl_fileinfo:
if (ZEND_SIZE_T_INT_OVFL(Z_STRLEN(key))) {
zval_dtor(&key);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an
invalid key (too long)", ZSTR_VAL(ce->name));
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an
invalid key (too long)", ZSTR_VAL(ce->name));
return ZEND_HASH_APPLY_STOP;
}
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 1e70021..4076c5a 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -295,7 +295,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
/* max command line length - two single quotes - \0 byte length */
if (l > cmd_max_len - 2 - 1) {
- php_error_docref(NULL, E_ERROR, "Command exceeds the allowed length of %d bytes",
cmd_max_len);
+ php_error_docref(NULL, E_ERROR, "Command exceeds the allowed length of %zu bytes",
cmd_max_len);
return ZSTR_EMPTY_ALLOC();
}
@@ -371,7 +371,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
ZSTR_VAL(cmd)[y] = '\0';
if (y > cmd_max_len + 1) {
- php_error_docref(NULL, E_ERROR, "Escaped command exceeds the allowed length of %d
bytes", cmd_max_len);
+ php_error_docref(NULL, E_ERROR, "Escaped command exceeds the allowed length of %zu
bytes", cmd_max_len);
zend_string_release(cmd);
return ZSTR_EMPTY_ALLOC();
}
@@ -399,7 +399,7 @@ PHPAPI zend_string *php_escape_shell_arg(char *str)
/* max command line length - two single quotes - \0 byte length */
if (l > cmd_max_len - 2 - 1) {
- php_error_docref(NULL, E_ERROR, "Argument exceeds the allowed length of %d bytes",
cmd_max_len);
+ php_error_docref(NULL, E_ERROR, "Argument exceeds the allowed length of %zu bytes",
cmd_max_len);
return ZSTR_EMPTY_ALLOC();
}
@@ -458,7 +458,7 @@ PHPAPI zend_string *php_escape_shell_arg(char *str)
ZSTR_VAL(cmd)[y] = '\0';
if (y > cmd_max_len + 1) {
- php_error_docref(NULL, E_ERROR, "Escaped argument exceeds the allowed length of %d
bytes", cmd_max_len);
+ php_error_docref(NULL, E_ERROR, "Escaped argument exceeds the allowed length of %zu
bytes", cmd_max_len);
zend_string_release(cmd);
return ZSTR_EMPTY_ALLOC();
}