postgresql/src/interfaces
Tom Lane 47bdd80dc1 Work around a subtle portability problem in use of printf %s format.
Depending on which spec you read, field widths and precisions in %s may be
counted either in bytes or characters.  Our code was assuming bytes, which
is wrong at least for glibc's implementation, and in any case libc might
have a different idea of the prevailing encoding than we do.  Hence, for
portable results we must avoid using anything more complex than just "%s"
unless the string to be printed is known to be all-ASCII.

This patch fixes the cases I could find, including the psql formatting
failure reported by Hernan Gonzalez.  In HEAD only, I also added comments
to some places where it appears safe to continue using "%.*s".
2010-05-08 16:40:52 +00:00
..
ecpg Remove outside-the-scanner references to "yyleng". 2009-09-08 04:26:17 +00:00
jdbc Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4, 2006-05-21 19:57:07 +00:00
libpgtcl Repair missing inclusions of -lintl for shared libraries. 2004-02-10 07:26:48 +00:00
libpq Work around a subtle portability problem in use of printf %s format. 2010-05-08 16:40:52 +00:00
Makefile clean python out of Makefile 2003-08-01 04:24:57 +00:00