mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
initialize srcstream
use different variable in local scope
This commit is contained in:
parent
f59d444d8a
commit
d5f90c48c7
@ -588,7 +588,7 @@ PHP_FUNCTION(file_put_contents)
|
||||
zval *zcontext = NULL;
|
||||
php_stream_context *context = NULL;
|
||||
char mode[3] = { 'w', 0, 0 };
|
||||
php_stream *srcstream;
|
||||
php_stream *srcstream = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "tz/|lr!", &filename, &filename_len, &filename_type,
|
||||
&data, &flags, &zcontext) == FAILURE) {
|
||||
@ -701,9 +701,9 @@ PHP_FUNCTION(file_put_contents)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write %d characters to %s", ustrlen, filename);
|
||||
numchars = -1;
|
||||
} else if (numchars != ustrlen) {
|
||||
int numchars = u_countChar32(Z_USTRVAL_P(data), numchars);
|
||||
int written_numchars = u_countChar32(Z_USTRVAL_P(data), numchars);
|
||||
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d characters written, possibly out of free disk space", numchars, ustrlen);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d characters written, possibly out of free disk space", written_numchars, ustrlen);
|
||||
numchars = -1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user