On Mon, 24 May 1999, Simon Drabble wrote:
# char query[LOTS_OF_ROOM];
# sprintf(query, "INSERT INTO octects VALUES(%d)", a);
#
# PQexec(conn, query);
snprintf would probably be a better choice.
# -or- download my libpq wrapper, which allows you to perform queries without
# using a temporary char array, in a manner similar to printf(). Available via
# anon ftp from
#
# brainkarma.dyndns.org/pub/dblib/
I was about to suggest something like this be part of the core
library. It makes a lot of sense, and that's what vsnprintf is for. :)
--
SA, beyond.com My girlfriend asked me which one I like better.
pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <[EMAIL PROTECTED]>
| Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________