diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-10 20:47:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-10 20:48:40 +0100 |
commit | 1412229c6e1284808b99cdcb33de99c511511b7f (patch) | |
tree | be8ee357b538ba934504ed5fa3c2b75d565471d2 /svtools | |
parent | 4f0a68ebc4476ee0a78e638d1a08007edf8d2e3a (diff) |
cppcheck: redundantCopy
just zero the un-overwritten new entries
Change-Id: Ifea1560a1c46ac5b10c04e6499c02e29a957191a
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/imivctl2.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx index 16ea52f775c9..9ca22786a81a 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; |