summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2016-01-31 11:01:25 +0100
committerJulien Nabet <serval2412@yahoo.fr>2016-01-31 11:06:20 +0100
commit9d63774dd469869f52b3dc4af2c71211fd984b33 (patch)
tree904161a5e6a1929e050622bd6843cc56b7a2f74a
parentbe859c9484fc984ca0ae5192cac6008af9897154 (diff)
cppcheck: fix redundantCopy
scalloc calls calloc which allocates and zero-initializes array (see http://www.cplusplus.com/reference/cstdlib/calloc/) Note: there was another useless memset to 0 not detected by cppcheck Change-Id: Icc6458aef2ffb05fd33a858a65e0ec2dd36a8307
-rw-r--r--vcl/source/fontsubset/ttcr.cxx2
1 files changed, 0 insertions, 2 deletions
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index 16e831fdea31..b2016b9acb3f 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -1015,7 +1015,6 @@ TrueTypeTable *TrueTypeTableNew_cmap()
cmap->n = 0;
cmap->m = CMAP_SUBTABLE_INIT;
cmap->s = static_cast<CmapSubTable *>(scalloc(CMAP_SUBTABLE_INIT, sizeof(CmapSubTable)));
- memset(cmap->s, 0, sizeof(CmapSubTable) * CMAP_SUBTABLE_INIT);
table->data = cmap;
@@ -1145,7 +1144,6 @@ void cmapAdd(TrueTypeTable *table, sal_uInt32 id, sal_uInt32 c, sal_uInt32 g)
if (!found) {
if (t->n == t->m) {
CmapSubTable* tmp = static_cast<CmapSubTable*>(scalloc(t->m + CMAP_SUBTABLE_INCR, sizeof(CmapSubTable)));
- memset(tmp, 0, t->m + CMAP_SUBTABLE_INCR * sizeof(CmapSubTable));
memcpy(tmp, s, sizeof(CmapSubTable) * t->m);
t->m += CMAP_SUBTABLE_INCR;
free(s);