From a12b4e279bc12a7cd7b7d679fcac4689ac4aba7b Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 2 Sep 2002 06:11:43 +0000 Subject: I checked all the previous string handling errors and most of them were already fixed by You. However there were a few left and attached patch should fix the rest of them. I used StringInfo only in 2 places and both of them are inside debug ifdefs. Only performance penalty will come from using strlen() like all the other code does. I also modified some of the already patched parts by changing snprintf(buf, 2 * BUFSIZE, ... style lines to snprintf(buf, sizeof(buf), ... where buf is an array. Jukka Holappa --- src/interfaces/libpgtcl/pgtclCmds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/interfaces/libpgtcl/pgtclCmds.c') diff --git a/src/interfaces/libpgtcl/pgtclCmds.c b/src/interfaces/libpgtcl/pgtclCmds.c index 0cb46686dc..901bcbfd32 100644 --- a/src/interfaces/libpgtcl/pgtclCmds.c +++ b/src/interfaces/libpgtcl/pgtclCmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.64 2002/08/18 01:39:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.65 2002/09/02 06:11:43 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1579,7 +1579,8 @@ Pg_lo_import(ClientData cData, Tcl_Interp *interp, int argc, char *argv[]) lobjId = lo_import(conn, filename); if (lobjId == InvalidOid) { - sprintf(interp->result, "Pg_lo_import of '%s' failed", filename); + /* What is the maximum size of this? FIXME if this is not a good quess */ + snprintf(interp->result, 128, "Pg_lo_import of '%s' failed", filename); return TCL_ERROR; } sprintf(interp->result, "%u", lobjId); -- cgit v1.2.1