summaryrefslogtreecommitdiff
path: root/ext/standard/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/exec.c')
-rw-r--r--ext/standard/exec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 7fc6acc033..63409520f0 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -172,8 +172,9 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value)
tmp = php_addslashes(buf, 0, &len, 0);
RETVAL_STRINGL(tmp,len,0);
- } else
- RETVAL_STRINGL(buf,l+1,1);
+ } else {
+ RETVAL_STRINGL(buf,l?l+1:0,1);
+ }
} else {
int b, i;