From: Antony Dovgal Date: Mon, 29 May 2006 10:42:10 +0000 (+0000) Subject: initialize srcstream X-Git-Tag: BEFORE_NEW_OUTPUT_API~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5f90c48c79d6c1676b2d6367db6111ffd1a2cd9;p=php initialize srcstream use different variable in local scope --- diff --git a/ext/standard/file.c b/ext/standard/file.c index 551605f871..e6c2b7744d 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -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; } }