]> granicus.if.org Git - postgis/commitdiff
Make the error message about wrong calculated size in twkb a little more verbose.
authorNicklas Avén <nicklas.aven@jordogskog.no>
Mon, 10 Mar 2014 20:25:17 +0000 (20:25 +0000)
committerNicklas Avén <nicklas.aven@jordogskog.no>
Mon, 10 Mar 2014 20:25:17 +0000 (20:25 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12321 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwout_twkb.c

index 0fcb70b173fd090c708ec6da95d061ee804ffd9b..666707bbf60fd36d0f3f57dcc4447f8a9c713af7 100644 (file)
@@ -885,8 +885,8 @@ uint8_t* lwgeom_to_twkb(const LWGEOM *geom, uint8_t variant, size_t *size_out,in
 
        if ( buf_size == 0 )
        {
-               LWDEBUG(4,"Error calculating output WKB buffer size.");
-               lwerror("Error calculating output WKB buffer size.");
+               LWDEBUG(4,"Error calculating output TWKB buffer size.");
+               lwerror("Error calculating output TWKB buffer size.");
                return NULL;
        }
 
@@ -894,8 +894,8 @@ uint8_t* lwgeom_to_twkb(const LWGEOM *geom, uint8_t variant, size_t *size_out,in
        buf = lwalloc(buf_size);
        if ( buf == NULL )
        {
-               LWDEBUGF(4,"Unable to allocate %d bytes for WKB output buffer.", buf_size);
-               lwerror("Unable to allocate %d bytes for WKB output buffer.", buf_size);
+               LWDEBUGF(4,"Unable to allocate %d bytes for TWKB output buffer.", buf_size);
+               lwerror("Unable to allocate %d bytes for TWKB output buffer.", buf_size);
                return NULL;
        }
 
@@ -924,8 +924,8 @@ uint8_t* lwgeom_to_twkb(const LWGEOM *geom, uint8_t variant, size_t *size_out,in
        /* The buffer pointer should now land at the end of the allocated buffer space. Let's check. */
        if ( buf_size != (buf - wkb_out) )
        {
-               LWDEBUG(4,"Output WKB is not the same size as the allocated buffer.");
-               lwerror("Output WKB is not the same size as the allocated buffer.");
+               LWDEBUG(4,"Output TWKB is not the same size as the allocated buffer.");
+               lwerror("Output TWKB is not the same size as the allocated buffer (precalculated size:%d, allocated size:%d)", buf_size, (buf - wkb_out));
                lwfree(wkb_out);
                return NULL;
        }
@@ -993,8 +993,8 @@ uint8_t* lwgeom_agg_to_twkb(const twkb_geom_arrays *lwgeom_arrays,uint8_t varian
 
        if ( buf_size == 0 )
        {
-               LWDEBUG(4,"Error calculating output WKB buffer size.");
-               lwerror("Error calculating output WKB buffer size.");
+               LWDEBUG(4,"Error calculating output TWKB buffer size.");
+               lwerror("Error calculating output TWKB buffer size.");
                return NULL;
        }
 
@@ -1060,8 +1060,8 @@ uint8_t* lwgeom_agg_to_twkb(const twkb_geom_arrays *lwgeom_arrays,uint8_t varian
        /* The buffer pointer should now land at the end of the allocated buffer space. Let's check. */
        if ( buf_size != (buf - wkb_out) )
        {
-               LWDEBUG(4,"Output WKB is not the same size as the allocated buffer.");
-               lwerror("Output WKB is not the same size as the allocated buffer.");
+               LWDEBUG(4,"Output TWKB is not the same size as the allocated buffer.");
+               lwerror("Output TWKB is not the same size as the allocated buffer (precalculated size:%d, allocated size:%d)", buf_size, (buf - wkb_out));
                lwfree(wkb_out);
                return NULL;
        }