diff options
author | Xinchen Hui <laruence@php.net> | 2015-07-08 19:30:37 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2015-07-08 19:30:58 +0800 |
commit | da333bfbd8ed9820922957cea70a562454548d84 (patch) | |
tree | abbf8e9cd3a4168424ba875f4e7707c7f5320368 /ext/standard/exec.c | |
parent | f9dc60f36f0c038cf4a77b096f76bea0ba438b18 (diff) | |
parent | 94957a7091d2d87d3b75c8395a3a11a4fbecaea1 (diff) | |
download | php-git-da333bfbd8ed9820922957cea70a562454548d84.tar.gz |
Fixed bug #70018 (exec does not strip all whitespace)
Merge branch 'PHP-5.6'
Conflicts:
ext/standard/exec.c
Diffstat (limited to 'ext/standard/exec.c')
-rw-r--r-- | ext/standard/exec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 55d777cb92..8dd0d5dfd7 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -116,7 +116,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value) } else if (type == 2) { /* strip trailing whitespaces */ l = bufl; - while (l >= 1 && l-- && isspace(((unsigned char *)buf)[l])); + while (l-- > 0 && isspace(((unsigned char *)buf)[l])); if (l != (bufl - 1)) { bufl = l + 1; buf[bufl] = '\0'; @@ -129,7 +129,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value) /* strip trailing whitespaces if we have not done so already */ if ((type == 2 && buf != b) || type != 2) { l = bufl; - while (l >= 1 && l-- && isspace(((unsigned char *)buf)[l])); + while (l-- > 0 && isspace(((unsigned char *)buf)[l])); if (l != (bufl - 1)) { bufl = l + 1; buf[bufl] = '\0'; |