]> granicus.if.org Git - php/commitdiff
One len variable is enough here, we can reuse it
authorLars Strojny <lstrojny@php.net>
Sat, 13 Dec 2008 15:06:20 +0000 (15:06 +0000)
committerLars Strojny <lstrojny@php.net>
Sat, 13 Dec 2008 15:06:20 +0000 (15:06 +0000)
ext/standard/file.c

index 4bddd0d19433998248c103c87ac8a9f6cc8ccf36..8bf018c0778292ce2500a8a549cf139ac0755c8f 100644 (file)
@@ -521,7 +521,7 @@ PHP_FUNCTION(file_get_contents)
        char *contents;
        zend_bool use_include_path = 0;
        php_stream *stream;
-       int len, newlen;
+       int len;
        long offset = -1;
        long maxlen = PHP_STREAM_COPY_ALL;
        zval *zcontext = NULL;
@@ -556,8 +556,7 @@ PHP_FUNCTION(file_get_contents)
        if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) {
 
                if (PG(magic_quotes_runtime)) {
-                       contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */
-                       len = newlen;
+                       contents = php_addslashes(contents, len, &len, 1 TSRMLS_CC); /* 1 = free source string */
                }
 
                RETVAL_STRINGL(contents, len, 0);