Browse Source

fix #36359 (splFileObject::fwrite() doesn't write when no data length specified)

migration/RELEASE_1_0_0
Antony Dovgal 21 years ago
parent
commit
50bbedcec3
  1. 4
      ext/spl/spl_directory.c

4
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) {

Loading…
Cancel
Save