]> granicus.if.org Git - postgis/commitdiff
Fix error in ptarray traversal.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 25 Oct 2012 20:36:00 +0000 (20:36 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 25 Oct 2012 20:36:00 +0000 (20:36 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10565 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/ptarray.c

index 75abf066bd8c4c0fd21d4f0e0b21d571e27f2ff3..fe8ea797603be75e9a2a9a0f33c65345dcb7dd87 100644 (file)
@@ -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)) );