From 359b557176b9bb2ff1aed2082641eed39c358d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 27 May 2020 14:58:02 +0200 Subject: New upstream version 5.1.2a --- app/bin/drawgeom.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'app/bin/drawgeom.c') diff --git a/app/bin/drawgeom.c b/app/bin/drawgeom.c index 6d4b237..2342599 100644 --- a/app/bin/drawgeom.c +++ b/app/bin/drawgeom.c @@ -65,7 +65,7 @@ static void EndPoly( drawContext_t * context, int cnt ) ErrorMessage( MSG_POLY_SHAPES_3_SIDES ); return; } - pts = (coOrd*)MyMalloc( (cnt+1) * sizeof *(coOrd*)NULL ); + pts = (coOrd*)MyMalloc( (cnt+1) * sizeof (coOrd) ); for ( inx=0; inxOp == OP_FILLBOX)?SEG_FILPOLY:SEG_POLY; @@ -564,7 +564,7 @@ STATUS_T DrawGeomModify( static BOOL_T corner_mode; int inx, inx1, inx2; DIST_T d, d1, d2, dd; - coOrd * newPts; + coOrd * newPts = NULL; int mergePoints; tempSegs_da.cnt = 1; switch ( action ) { @@ -837,8 +837,9 @@ STATUS_T DrawGeomModify( } coOrd * oldPts = segPtr[segInx].u.p.pts; - newPts = (coOrd*)MyMalloc( tempSegs(0).u.p.cnt * sizeof *(coOrd*)0 ); - memcpy( newPts, segPtr[segInx].u.p.pts, (segPtr[segInx].u.p.cnt) * sizeof *(coOrd*)0 ); + newPts = (coOrd*)MyMalloc( tempSegs(0).u.p.cnt * sizeof (coOrd) ); + int size = segPtr[segInx].u.p.cnt; + memcpy( newPts, segPtr[segInx].u.p.pts, (size) * sizeof (coOrd) ); segPtr[segInx].u.p.pts = newPts; MyFree(oldPts); @@ -852,7 +853,7 @@ STATUS_T DrawGeomModify( pos = points(polyInx); if ( mergePoints ) { - for (inx=polyInx+1; inx