[postgis-commits] svn - r2712 - trunk/lwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Mon Oct 29 05:34:18 PDT 2007


Author: mcayland
Date: 2007-10-29 05:34:17 -0700 (Mon, 29 Oct 2007)
New Revision: 2712

Modified:
   trunk/lwgeom/lwpoint.c
Log:
Fix broken error message when attempting to deserialise a type other than a point; the message should now correctly show the name of the offending type. Patch supplied by Charlie Savage.

Modified: trunk/lwgeom/lwpoint.c
===================================================================
--- trunk/lwgeom/lwpoint.c	2007-10-23 00:19:54 UTC (rev 2711)
+++ trunk/lwgeom/lwpoint.c	2007-10-29 12:34:17 UTC (rev 2712)
@@ -256,6 +256,7 @@
 lwpoint_deserialize(uchar *serialized_form)
 {
 	uchar type;
+	int geom_type;
 	LWPOINT *result;
 	uchar *loc = NULL;
 	POINTARRAY *pa;
@@ -267,10 +268,11 @@
 	result = (LWPOINT*) lwalloc(sizeof(LWPOINT)) ;
 
 	type = serialized_form[0];
+	geom_type = lwgeom_getType(type);
 
-	if ( lwgeom_getType(type) != POINTTYPE)
+	if ( geom_type != POINTTYPE)
 	{
-		lwerror("lwpoint_deserialize: attempt to deserialize a point which is really a %s", lwgeom_typename(type));
+		lwerror("lwpoint_deserialize: attempt to deserialize a point which is really a %s", lwgeom_typename(geom_type));
 		return NULL;
 	}
 	result->type = type;



More information about the postgis-commits mailing list