summaryrefslogtreecommitdiff
path: root/tools/source/zcodec/zcodec.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 11:39:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 12:44:46 +0200
commit0b2ddcda730897cb5b2801731f03191d77409273 (patch)
tree063c9beae80927710fef7ac8b5bc22d458004de9 /tools/source/zcodec/zcodec.cxx
parent3cb8e9e211c30089516f56f465176d3a959631f9 (diff)
loplugin:buriedassign in tools..xmloff
Change-Id: I31df6c4fd82c6f6d15bbe5228e92e5171cacba51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92410 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools/source/zcodec/zcodec.cxx')
-rw-r--r--tools/source/zcodec/zcodec.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx
index a29127be7232..b6b1b2112b32 100644
--- a/tools/source/zcodec/zcodec.cxx
+++ b/tools/source/zcodec/zcodec.cxx
@@ -119,9 +119,12 @@ void ZCodec::Compress( SvStream& rIStm, SvStream& rOStm )
InitCompress();
mpInBuf = new sal_uInt8[ mnInBufSize ];
auto pStream = static_cast<z_stream*>(mpsC_Stream);
- while ((pStream->avail_in = rIStm.ReadBytes(
- pStream->next_in = mpInBuf, mnInBufSize )) != 0)
+ for (;;)
{
+ pStream->next_in = mpInBuf;
+ pStream->avail_in = rIStm.ReadBytes( pStream->next_in, mnInBufSize );
+ if (pStream->avail_in == 0)
+ break;
if ( pStream->avail_out == 0 )
ImplWriteBack();
if ( deflate( pStream, Z_NO_FLUSH ) < 0 )
@@ -142,7 +145,8 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
assert(meState == STATE_INIT);
mpOStm = &rOStm;
InitDecompress(rIStm);
- pStream->next_out = mpOutBuf = new sal_uInt8[ pStream->avail_out = mnOutBufSize ];
+ pStream->avail_out = mnOutBufSize;
+ pStream->next_out = mpOutBuf = new sal_uInt8[ pStream->avail_out ];
do
{
if ( pStream->avail_out == 0 ) ImplWriteBack();