diff options
Diffstat (limited to 'ext/standard/exec.c')
-rw-r--r-- | ext/standard/exec.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 6720231089..94c5a26937 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -171,7 +171,7 @@ err: static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ { char *cmd; - int cmd_len; + size_t cmd_len; zval *ret_code=NULL, *ret_array=NULL; int ret; @@ -247,7 +247,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str) TSRMLS_FETCH(); - cmd = STR_ALLOC(2 * l, 0); + cmd = zend_string_alloc(2 * l, 0); for (x = 0, y = 0; x < l; x++) { int mb_len = php_mblen(str + x, (l - x)); @@ -320,7 +320,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str) if ((estimate - y) > 4096) { /* realloc if the estimate was way overill * Arbitrary cutoff point of 4096 */ - cmd = STR_REALLOC(cmd, y, 0); + cmd = zend_string_realloc(cmd, y, 0); } cmd->len = y; @@ -339,7 +339,7 @@ PHPAPI zend_string *php_escape_shell_arg(char *str) TSRMLS_FETCH(); - cmd = STR_ALLOC(4 * l + 2, 0); /* worst case */ + cmd = zend_string_alloc(4 * l + 2, 0); /* worst case */ #ifdef PHP_WIN32 cmd->val[y++] = '"'; @@ -387,7 +387,7 @@ PHPAPI zend_string *php_escape_shell_arg(char *str) if ((estimate - y) > 4096) { /* realloc if the estimate was way overill * Arbitrary cutoff point of 4096 */ - cmd = STR_REALLOC(cmd, y, 0); + cmd = zend_string_realloc(cmd, y, 0); } cmd->len = y; return cmd; @@ -399,8 +399,7 @@ PHPAPI zend_string *php_escape_shell_arg(char *str) PHP_FUNCTION(escapeshellcmd) { char *command; - int command_len; - char *cmd = NULL; + size_t command_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) { return; @@ -419,8 +418,7 @@ PHP_FUNCTION(escapeshellcmd) PHP_FUNCTION(escapeshellarg) { char *argument; - int argument_len; - char *cmd = NULL; + size_t argument_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &argument, &argument_len) == FAILURE) { return; @@ -438,7 +436,7 @@ PHP_FUNCTION(shell_exec) { FILE *in; char *command; - int command_len; + size_t command_len; zend_string *ret; php_stream *stream; @@ -470,7 +468,7 @@ PHP_FUNCTION(shell_exec) Change the priority of the current process */ PHP_FUNCTION(proc_nice) { - long pri; + zend_long pri; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pri) == FAILURE) { RETURN_FALSE; |