[Libreoffice-commits] core.git: svtools/source

Caolán McNamara caolanm at redhat.com
Sat Oct 10 13:10:35 PDT 2015


 svtools/source/contnr/imivctl2.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1412229c6e1284808b99cdcb33de99c511511b7f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Oct 10 20:47:32 2015 +0100

    cppcheck: redundantCopy
    
    just zero the un-overwritten new entries
    
    Change-Id: Ifea1560a1c46ac5b10c04e6499c02e29a957191a

diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx
index 16ea52f..9ca2278 100644
--- a/svtools/source/contnr/imivctl2.cxx
+++ b/svtools/source/contnr/imivctl2.cxx
@@ -559,9 +559,9 @@ void IcnGridMap_Impl::Expand()
 
         size_t nNewCellCount = static_cast<size_t>(nNewGridRows) * nNewGridCols;
         bool* pNewGridMap = new bool[nNewCellCount];
-        memset(pNewGridMap, 0, nNewCellCount * sizeof(bool));
         size_t nOldCellCount = static_cast<size_t>(_nGridRows) * _nGridCols;
         memcpy(pNewGridMap, _pGridMap, nOldCellCount * sizeof(bool));
+        memset(pNewGridMap + nOldCellCount, 0, (nNewCellCount-nOldCellCount) * sizeof(bool));
         delete[] _pGridMap;
         _pGridMap = pNewGridMap;
         _nGridRows = nNewGridRows;


More information about the Libreoffice-commits mailing list