diff options
author | Antony Dovgal <tony2001@php.net> | 2006-02-10 16:56:56 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-02-10 16:56:56 +0000 |
commit | 50bbedcec35442f48077cff6f726a1178c08e68c (patch) | |
tree | cd8cb10892c31d05b0dc002fadc36d8f71273c32 | |
parent | a5883cc89c53df8e14eddba321986b300a2923c5 (diff) | |
download | php-git-50bbedcec35442f48077cff6f726a1178c08e68c.tar.gz |
fix #36359 (splFileObject::fwrite() doesn't write when no data length specified)
-rwxr-xr-x | ext/spl/spl_directory.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 6fde9737cc..0e952ca392 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1809,13 +1809,13 @@ SPL_METHOD(SplFileObject, fwrite) char *str; int str_len; int ret; - long length; + long length = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &length) == FAILURE) { return; } - if (ZEND_NUM_ARGS() < 2) { + if (ZEND_NUM_ARGS() > 1) { str_len = MAX(0, MIN(length, str_len)); } if (!str_len) { |