Remove our dependencies on MB_CUR_MAX in favor of believing that
commit947b1624f31d57b8e872d7cb8ffef9bc64f4b245
authortgl <tgl>
Mon, 15 Dec 2008 14:55:50 +0000 (15 14:55 +0000)
committertgl <tgl>
Mon, 15 Dec 2008 14:55:50 +0000 (15 14:55 +0000)
treed01d60ec6030b33d9ba2e34188cf96ca401dee6e
parentd7d597361dce0e2d1fe296b131ce43cde353ca6f
Remove our dependencies on MB_CUR_MAX in favor of believing that
pg_database_encoding_max_length() predicts the maximum character length
returned by wchar2char().  Per Hiroshi Inoue, MB_CUR_MAX isn't usable on
Windows because we allow encoding = UTF8 when the locale says differently;
and getting rid of it seems a good idea on general principles because it
narrows our dependence on libc's locale API just a little bit more.

Also install a check for overflow of the buffer size computation.
src/backend/utils/adt/formatting.c