From: Paul Ramsey Date: Thu, 25 Oct 2012 20:36:00 +0000 (+0000) Subject: Fix error in ptarray traversal. X-Git-Tag: 2.1.0beta2~453 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=752583350f4688576bf7796f0a1c9ca522c04a93;p=postgis Fix error in ptarray traversal. git-svn-id: http://svn.osgeo.org/postgis/trunk@10565 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index 75abf066b..fe8ea7976 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1551,7 +1551,7 @@ ptarray_length(const POINTARRAY *pts) getPoint3dz_p(pts, 0, &frm); for ( i=1; i < pts->npoints; i++ ) { - getPoint3dz_p(pts, i+1, &to); + getPoint3dz_p(pts, i, &to); dist += sqrt( ((frm.x - to.x)*(frm.x - to.x)) + ((frm.y - to.y)*(frm.y - to.y)) + ((frm.z - to.z)*(frm.z - to.z)) );