From b399cdec047382eccccf751496db24df32a83aee Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Thu, 6 Sep 2018 20:17:00 +0000 Subject: [PATCH] Increase double printing buffer, and strip out assertion that buffer is never filled (References #4165) git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@16716 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwout_wkt.c | 5 +++-- liblwgeom/lwprint.c | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/liblwgeom/lwout_wkt.c b/liblwgeom/lwout_wkt.c index 881065786..ab05f6b3f 100644 --- a/liblwgeom/lwout_wkt.c +++ b/liblwgeom/lwout_wkt.c @@ -85,7 +85,8 @@ static void ptarray_to_wkt_sb(const POINTARRAY *ptarray, stringbuffer_t *sb, int /* OGC only includes X/Y */ uint32_t dimensions = 2; uint32_t i, j; - char coord[OUT_DOUBLE_BUFFER_SIZE]; + static size_t buffer_size = 128; + char coord[buffer_size]; /* ISO and extended formats include all dimensions */ if ( variant & ( WKT_ISO | WKT_EXTENDED ) ) @@ -112,7 +113,7 @@ static void ptarray_to_wkt_sb(const POINTARRAY *ptarray, stringbuffer_t *sb, int lwprint_double(dbl_ptr[j], precision, coord, - OUT_DOUBLE_BUFFER_SIZE); + buffer_size); stringbuffer_append(sb, coord); } } diff --git a/liblwgeom/lwprint.c b/liblwgeom/lwprint.c index c588871c4..af56c4c27 100644 --- a/liblwgeom/lwprint.c +++ b/liblwgeom/lwprint.c @@ -507,7 +507,6 @@ lwprint_double(double d, int maxdd, char* buf, size_t bufsize) { length = snprintf(buf, bufsize, "%g", d); } - assert(length < (int) bufsize); trim_trailing_zeros(buf); return length; } \ No newline at end of file -- 2.50.0