]> granicus.if.org Git - php/commitdiff
initialize srcstream
authorAntony Dovgal <tony2001@php.net>
Mon, 29 May 2006 10:42:10 +0000 (10:42 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 29 May 2006 10:42:10 +0000 (10:42 +0000)
use different variable in local scope

ext/standard/file.c

index 551605f871544ee3994204e02d5b9beb7fceaf6f..e6c2b7744d123ae88bd6848fe36833574b6f2ff1 100644 (file)
@@ -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;
                                }
                        }