From: Pawel Date: Thu, 12 Jul 2012 11:13:58 +0000 (+0200) Subject: 0023268: cppcheck warning: Using size of pointer WIDTHMAP instead of size of its... X-Git-Tag: V6_5_4_beta1~134 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=8bde65b4534c8548ec492398c072fcc29408fbfb;p=occt-copy.git 0023268: cppcheck warning: Using size of pointer WIDTHMAP instead of size of its data. Using the size of the array in bytes. --- diff --git a/src/CGM/CGM_Driver.cxx b/src/CGM/CGM_Driver.cxx index d2b63b7fa8..a012245e7d 100755 --- a/src/CGM/CGM_Driver.cxx +++ b/src/CGM/CGM_Driver.cxx @@ -382,7 +382,7 @@ void CGM_Driver::InitializeWidthMap (const Handle(Aspect_WidthMap)& aWidthMap) if (WIDTHMAP) delete[] WIDTHMAP; WIDTHMAP = new float[Size]; - memset (WIDTHMAP, 0, sizeof(WIDTHMAP)); + memset (WIDTHMAP, 0, Size * sizeof(float)); for (Standard_Integer i=1; i<= Size; i++) { Standard_Real w = aWidthMap->Entry(i).Width(); WIDTHMAP[aWidthMap->Entry(i).Index()] = (float)w;