[postgis-tickets] r16716 - Increase double printing buffer, and strip out assertion that buffer is never filled

Paul Ramsey pramsey at cleverelephant.ca
Thu Sep 6 01:17:00 PDT 2018


Author: pramsey
Date: 2018-09-06 13:17:00 -0700 (Thu, 06 Sep 2018)
New Revision: 16716

Modified:
   branches/2.5/liblwgeom/lwout_wkt.c
   branches/2.5/liblwgeom/lwprint.c
Log:
Increase double printing buffer, and strip out assertion that buffer is never filled
(References #4165)


Modified: branches/2.5/liblwgeom/lwout_wkt.c
===================================================================
--- branches/2.5/liblwgeom/lwout_wkt.c	2018-09-06 18:16:18 UTC (rev 16715)
+++ branches/2.5/liblwgeom/lwout_wkt.c	2018-09-06 20:17:00 UTC (rev 16716)
@@ -85,7 +85,8 @@
 	/* 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 @@
 			lwprint_double(dbl_ptr[j],
 				       precision,
 				       coord,
-				       OUT_DOUBLE_BUFFER_SIZE);
+				       buffer_size);
 			stringbuffer_append(sb, coord);
 		}
 	}

Modified: branches/2.5/liblwgeom/lwprint.c
===================================================================
--- branches/2.5/liblwgeom/lwprint.c	2018-09-06 18:16:18 UTC (rev 16715)
+++ branches/2.5/liblwgeom/lwprint.c	2018-09-06 20:17:00 UTC (rev 16716)
@@ -507,7 +507,6 @@
 	{
 		length = snprintf(buf, bufsize, "%g", d);
 	}
-	assert(length < (int) bufsize);
 	trim_trailing_zeros(buf);
 	return length;
 }
\ No newline at end of file



More information about the postgis-tickets mailing list