0023268: cppcheck warning: Using size of pointer WIDTHMAP instead of size of its...
authorPawel <pawel-kowalski@wp.pl>
Thu, 12 Jul 2012 11:13:58 +0000 (13:13 +0200)
committerPawel <pawel-kowalski@wp.pl>
Fri, 13 Jul 2012 13:38:04 +0000 (17:38 +0400)
Using the size of the array in bytes.

src/CGM/CGM_Driver.cxx

index d2b63b7..a012245 100755 (executable)
@@ -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;