diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-12-05 12:26:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-12-05 12:26:06 +0000 |
commit | e5a229ef94badaea0d6eb2714d7e8d9a81c3cc2c (patch) | |
tree | 878470a37d0054761a3ec3225900bc3b996048dc | |
parent | 0f56d59f0c818b3d63651d76d0a0bf15a1669988 (diff) |
cppcheck: scope of these variables can be reduced
-rw-r--r-- | tools/source/generic/config.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx index e8d9129c2fb2..1dadb4edb55f 100644 --- a/tools/source/generic/config.cxx +++ b/tools/source/generic/config.cxx @@ -130,7 +130,7 @@ static BYTE* ImplSysReadConfig( const XubString& rFileName, if( aFile.open( osl_File_OpenFlag_Read ) == ::osl::FileBase::E_None ) { - sal_uInt64 nPos = 0, nRead = 0; + sal_uInt64 nPos = 0; if( aFile.getSize( nPos ) == ::osl::FileBase::E_None ) { if (nPos > std::numeric_limits< std::size_t >::max()) { @@ -138,6 +138,7 @@ static BYTE* ImplSysReadConfig( const XubString& rFileName, return 0; } pBuf = new BYTE[static_cast< std::size_t >(nPos)]; + sal_uInt64 nRead = 0; if( aFile.read( pBuf, nPos, nRead ) == ::osl::FileBase::E_None && nRead == nPos ) { //skip the byte-order-mark 0xEF 0xBB 0xBF, if it was UTF8 files |