summaryrefslogtreecommitdiff
path: root/idlc/source/idlccompile.cxx
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2014-12-17 21:16:11 +0100
committerNoel Grandin <noelgrandin@gmail.com>2014-12-18 06:39:15 +0000
commita23f6eb3ae49dfc326c6e57a8ab95a840c0661d2 (patch)
treee4bfa45604b2a62a6683573305763dd13f195e33 /idlc/source/idlccompile.cxx
parent36936c2580bf15117dd3bf775dd91340d16d3239 (diff)
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings. Change-Id: Ib16e4ecc0e0c43b2c1fb527eb0668a960ae9756e Reviewed-on: https://gerrit.libreoffice.org/13513 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'idlc/source/idlccompile.cxx')
-rw-r--r--idlc/source/idlccompile.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index 45dbfbcfb694..3d4ef7d22b1a 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -186,11 +186,11 @@ bool copyFile(const OString* source, const OString& target)
}
size_t totalSize = 512;
- size_t readSize = 0;
char pBuffer[513];
while ( !feof(pSource) )
{
+ size_t readSize;
if ( (readSize = fread(pBuffer, 1, totalSize, pSource)) > 0 && !ferror(pSource) )
{
if ( (fwrite(pBuffer, 1, readSize, pTarget)) != readSize || ferror(pTarget) )