]> granicus.if.org Git - postgis/commitdiff
Fix broken error message when attempting to deserialise a type other than a point...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 29 Oct 2007 12:34:17 +0000 (12:34 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 29 Oct 2007 12:34:17 +0000 (12:34 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2712 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwpoint.c

index ceb4a9ae63098522c5f220560ea7c576a52fc5e8..26503c40734fbc5075d0ac9a9b55d1ba6e8848a6 100644 (file)
@@ -256,6 +256,7 @@ LWPOINT *
 lwpoint_deserialize(uchar *serialized_form)
 {
        uchar type;
+       int geom_type;
        LWPOINT *result;
        uchar *loc = NULL;
        POINTARRAY *pa;
@@ -267,10 +268,11 @@ lwpoint_deserialize(uchar *serialized_form)
        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;