Use "g" not "f" format in ecpg's PGTYPESnumeric_from_double().

Tom Lane <tgl@sss.pgh.pa.us>

Commit: c79bdc9904afefeee495455be7dea737d714fbb4
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2015-12-01T16:42:35Z
Releases: 9.5.0
Use "g" not "f" format in ecpg's PGTYPESnumeric_from_double().

The previous coding could overrun the provided buffer size for a very large
input, or lose precision for a very small input.  Adopt the methodology
that's been in use in the equivalent backend code for a long time.

Per private report from Bas van Schaik.  Back-patch to all supported
branches.

Files

PathChange+/−
src/interfaces/ecpg/pgtypeslib/numeric.c modified +3 −2