]> granicus.if.org Git - postgresql/commit
Use "g" not "f" format in ecpg's PGTYPESnumeric_from_double().
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 1 Dec 2015 16:42:25 +0000 (11:42 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 1 Dec 2015 16:42:39 +0000 (11:42 -0500)
commit346cc2f0192791b5ee0fb5de4276d3cb8f5ab9a6
tree7bb3204a30dd24642a4d6fcd0a36392b2f34ed2a
parentb7fc1dd1fed3c38b1d95c6433b65cbbd22c0323f
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.
src/interfaces/ecpg/pgtypeslib/numeric.c