From 70ed00f87e691f6e9d49688859b763712d55eee7 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 12 Dec 2003 18:00:15 +0000 Subject: [PATCH] reverted make_line patch, patched size_subobject instead - the reported bug was caused to their inconsistency git-svn-id: http://svn.osgeo.org/postgis/trunk@410 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis_inout.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/postgis_inout.c b/postgis_inout.c index b37c2eebb..0f6351594 100644 --- a/postgis_inout.c +++ b/postgis_inout.c @@ -11,6 +11,9 @@ * ********************************************************************** * $Log$ + * Revision 1.35 2003/12/12 18:00:15 strk + * reverted make_line patch, patched size_subobject instead - the reported bug was caused to their inconsistency + * * Revision 1.34 2003/12/12 14:39:04 strk * Fixed a bug in make_line allocating less memory then required * @@ -3094,7 +3097,8 @@ int size_subobject (char *sub_obj, int type) } if (type == LINETYPE) { - return(sizeof(LINE3D) + sizeof(POINT3D) * ( ((LINE3D *)sub_obj)->npoints )); + /* size of first point is included in struct LINE3D */ + return(sizeof(LINE3D) + sizeof(POINT3D) * ( ((LINE3D *)sub_obj)->npoints - 1 )); } if (type==POLYGONTYPE) { @@ -3275,7 +3279,7 @@ LINE3D *make_line(int npoints, POINT3D *pts, int *size) { LINE3D *result; - *size = sizeof(LINE3D) + (npoints)*sizeof(POINT3D); + *size = sizeof(LINE3D) + (npoints-1)*sizeof(POINT3D); result= (LINE3D *) palloc (*size); -- 2.40.0