diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-05-27 14:58:13 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-05-27 14:58:13 +0200 |
commit | 265d6934cd70a60228e7a11cfc000aff73dd4701 (patch) | |
tree | 610eb753fea70e7f407e751e22697fc8a1ec04bd /app/bin/drawgeom.c | |
parent | bd8c21a35fd05fcbdaa95e4c0b7c94c3b97507b6 (diff) | |
parent | 359b557176b9bb2ff1aed2082641eed39c358d0d (diff) |
Update upstream source from tag 'upstream/5.1.2a'
Update to upstream version '5.1.2a'
with Debian dir 4d0d8239e41bb5de5dc968c2a5c6eb9c140bb2f3
Diffstat (limited to 'app/bin/drawgeom.c')
-rw-r--r-- | app/bin/drawgeom.c | 13 |
1 files changed, 7 insertions, 6 deletions
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; inx<cnt; inx++ ) pts[inx] = tempSegs(inx).u.l.pos[0]; pts[cnt] = tempSegs(cnt-1).u.l.pos[1]; @@ -485,7 +485,7 @@ STATUS_T DrawGeomMouse( break; case OP_BOX: case OP_FILLBOX: - pts = (coOrd*)MyMalloc( 4 * sizeof *(coOrd*)NULL ); + pts = (coOrd*)MyMalloc( 4 * sizeof (coOrd) ); for ( inx=0; inx<4; inx++ ) pts[inx] = tempSegs(inx).u.l.pos[0]; tempSegs(0).type = (context->Op == 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<points_da.cnt; inx++) + for (inx=polyInx+1; inx<segPtr[segInx].u.p.cnt; inx++) segPtr[segInx].u.p.pts[inx-1] = segPtr[segInx].u.p.pts[inx]; segPtr[segInx].u.p.cnt--; /*fprintf( stderr, "Merging with vertix %d\n", polyInx );*/ |