summaryrefslogtreecommitdiff
path: root/app/bin/drawgeom.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-06-01 17:08:47 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-06-01 17:08:47 +0200
commitd0b6a8a4ec298024f14f704f9e40a6f9d324ccf3 (patch)
tree8645f5abd7b89361a1c5ab67e0195c84bc2ceab0 /app/bin/drawgeom.c
parentc2b8ba9336499ac930802e957f0d150399f3191e (diff)
parentabf57604846230dc26afe8011aefb8e7bcc34333 (diff)
Merge debian/watchdebian/1_5.1.2a-1
Diffstat (limited to 'app/bin/drawgeom.c')
-rw-r--r--app/bin/drawgeom.c13
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 );*/