From: Sandro Santilli Date: Sun, 20 Nov 2011 21:19:12 +0000 (+0000) Subject: Do not memcpy to self in ptarray_reverse (see #1302) X-Git-Tag: 2.0.0alpha1~667 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70e7934d65f66dcd19167379abb85536d98d9ae8;p=postgis Do not memcpy to self in ptarray_reverse (see #1302) git-svn-id: http://svn.osgeo.org/postgis/trunk@8193 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index e58b9fe98..059d95092 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -281,14 +281,14 @@ void ptarray_free(POINTARRAY *pa) void ptarray_reverse(POINTARRAY *pa) { - /* TODO change this to double array operations once point array is double alligned */ + /* TODO change this to double array operations once point array is double aligned */ POINT4D pbuf; uint32_t i; int ptsize = ptarray_point_size(pa); int last = pa->npoints-1; - int mid = last/2; + int mid = pa->npoints/2; - for (i=0; i<=mid; i++) + for (i=0; i