[Libreoffice-commits] .: tools/source
Caolán McNamara
caolan at kemper.freedesktop.org
Sun Dec 5 04:26:18 PST 2010
tools/source/generic/config.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit e2b7db184e7c0c15b49a9cfa67b32d0e0bf468fe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Dec 5 12:26:06 2010 +0000
cppcheck: scope of these variables can be reduced
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index 85e7448..dbda958 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
More information about the Libreoffice-commits
mailing list