]> granicus.if.org Git - postgis/commitdiff
ST_AddPoint returns incorrect result on Linux (#1335) from roualt
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 29 Nov 2011 20:22:40 +0000 (20:22 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 29 Nov 2011 20:22:40 +0000 (20:22 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8257 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/ptarray.c

index bd2992d9a04846c5590259fdd7b9cb39b259a960..c5f8834f182384c625ff48a571fea5eaa54c06f3 100644 (file)
@@ -107,7 +107,7 @@ ptarray_insert_point(POINTARRAY *pa, POINT4D *p, int where)
        if( where < pa->npoints )
        {
                size_t copy_size = point_size * (pa->npoints - where);
-               memcpy(getPoint_internal(pa, where+1), getPoint_internal(pa, where), copy_size);
+               memmove(getPoint_internal(pa, where+1), getPoint_internal(pa, where), copy_size);
                LWDEBUGF(5,"copying %d bytes to start vertex %d from start vertex %d", copy_size, where+1, where);
        }
        
@@ -218,7 +218,7 @@ ptarray_remove_point(POINTARRAY *pa, int where)
        /* If the point is any but the last, we need to copy the data back one point */
        if( where < pa->npoints - 1 )
        {
-               memcpy(getPoint_internal(pa, where), getPoint_internal(pa, where+1), ptsize * (pa->npoints - where - 1));
+               memmove(getPoint_internal(pa, where), getPoint_internal(pa, where+1), ptsize * (pa->npoints - where - 1));
        }
        
        /* We have one less point */