summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-02-10 16:56:56 +0000
committerAntony Dovgal <tony2001@php.net>2006-02-10 16:56:56 +0000
commit50bbedcec35442f48077cff6f726a1178c08e68c (patch)
treecd8cb10892c31d05b0dc002fadc36d8f71273c32
parenta5883cc89c53df8e14eddba321986b300a2923c5 (diff)
downloadphp-git-50bbedcec35442f48077cff6f726a1178c08e68c.tar.gz
fix #36359 (splFileObject::fwrite() doesn't write when no data length specified)
-rwxr-xr-xext/spl/spl_directory.c4
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) {