From: Paul Ramsey Date: Tue, 2 Jun 2015 16:03:05 +0000 (+0000) Subject: #3143, use right type size / simpler pointer math? X-Git-Tag: 2.2.0rc1~414 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=434fb12fd2668eb56c035f0e1160e2a05a9b23e4;p=postgis #3143, use right type size / simpler pointer math? git-svn-id: http://svn.osgeo.org/postgis/trunk@13601 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwlinearreferencing.c b/liblwgeom/lwlinearreferencing.c index 1db0ff3c5..b7ede2359 100644 --- a/liblwgeom/lwlinearreferencing.c +++ b/liblwgeom/lwlinearreferencing.c @@ -1099,12 +1099,12 @@ lwgeom_tcpa(const LWGEOM *g1, const LWGEOM *g2, double *mindist) * Collect M values in common time range from inputs */ - mvals = lwalloc( sizeof(double*) * + mvals = lwalloc( sizeof(double) * ( l1->points->npoints + l2->points->npoints ) ); /* TODO: also clip the lines ? */ nmvals = ptarray_collect_mvals(l1->points, tmin, tmax, mvals); - nmvals += ptarray_collect_mvals(l2->points, tmin, tmax, &(mvals[nmvals])); + nmvals += ptarray_collect_mvals(l2->points, tmin, tmax, mvals + nmvals); /* Sort values in ascending order */ qsort(mvals, nmvals, sizeof(double), compare_double);