From: Nicklas Avén Date: Tue, 30 Sep 2014 04:16:10 +0000 (+0000) Subject: This should repair the build but the emty geometry twkb is still corrupt X-Git-Tag: 2.2.0rc1~826 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=122913b904f1ea6f2bae82553776a8016d1204d3;p=postgis This should repair the build but the emty geometry twkb is still corrupt git-svn-id: http://svn.osgeo.org/postgis/trunk@13009 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwout_twkb.c b/liblwgeom/lwout_twkb.c index 86ef8cd31..998335c2c 100644 --- a/liblwgeom/lwout_twkb.c +++ b/liblwgeom/lwout_twkb.c @@ -107,7 +107,7 @@ static int uint8_to_twkb_buf(const uint8_t ival, uint8_t **buf) static size_t empty_to_twkb_size(const LWGEOM *geom, uint8_t variant, int64_t id) { LWDEBUGF(2, "Entered empty_to_twkb_size",0); - size_t size=0; + size_t size = WKB_BYTE_SIZE + WKB_BYTE_SIZE; /*size of ID*/ size += varint_s64_encoded_size((int64_t) id); /*size of npoints*/ @@ -128,6 +128,11 @@ static int empty_to_twkb_buf(const LWGEOM *geom, uint8_t **buf, uint8_t variant, } uint8_t flag=0; + /* Set the id flag */ + FIRST_BYTE_SET_ID(flag, ((variant & TWKB_ID) ? 1 : 0)); + /* Tell what precision to use*/ + FIRST_BYTE_SET_PRECISION(flag,0); + /*Copy the flag to the buffer*/ uint8_to_twkb_buf(flag,buf);