]> granicus.if.org Git - postgis/commitdiff
Fixed typo in add_to_geometry(). With very poorly aligned sub-objects, it
authorDavid Blasby <dblasby@gmail.com>
Mon, 6 Oct 2003 18:09:08 +0000 (18:09 +0000)
committerDavid Blasby <dblasby@gmail.com>
Mon, 6 Oct 2003 18:09:08 +0000 (18:09 +0000)
wouldnt allocate enough memory.  Fixed it so its pesimistic and will allocate
enough memory.

git-svn-id: http://svn.osgeo.org/postgis/trunk@307 b70326c6-7e19-0410-871a-916f4a2858ee

postgis_inout.c

index 728f4f3ad84100d672d9f33a9c11ca67c4b6312a..c7a16045656c12199d4fe59b0dcda5cd5f9d3e8d 100644 (file)
  *
  **********************************************************************
  * $Log$
+ * Revision 1.28  2003/10/06 18:09:08  dblasby
+ * Fixed typo in add_to_geometry().  With very poorly aligned sub-objects, it
+ * wouldnt allocate enough memory.  Fixed it so its pesimistic and will allocate
+ * enough memory.
+ *
  * Revision 1.27  2003/08/22 17:40:11  dblasby
  * fixed geometry_in('SRID=<int>{no ;}').
  *
@@ -3086,8 +3091,8 @@ GEOMETRY  *add_to_geometry(GEOMETRY *geom,int sub_obj_size, char *sub_obj, int ty
        GEOMETRY        *result;
        int32           *old_offsets, *new_offsets;
 
-       //all the offsets could cause re-alignment problems, so need to deal with each on
-       size = geom->size +(4*geom->nobjs +1) /*byte align*/
+       //all the offsets could cause re-alignment problems, so need to deal with each one
+       size = geom->size +4*(geom->nobjs +1) /*byte align*/
                        +sub_obj_size + 4 /*ObjType[]*/ +4 /*new offset*/;
 
        result = (GEOMETRY *) palloc(size);