mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
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
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000-2002 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.78 2002/08/14 05:49:22 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.79 2002/09/02 06:11:42 momjian Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "command.h"
|
||||
@ -1549,7 +1549,7 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
|
||||
#ifndef WIN32
|
||||
const char *tmpdirenv = getenv("TMPDIR");
|
||||
|
||||
sprintf(fnametmp, "%s/psql.edit.%ld.%ld",
|
||||
snprintf(fnametmp, sizeof(fnametmp), "%s/psql.edit.%ld.%ld",
|
||||
tmpdirenv ? tmpdirenv : "/tmp",
|
||||
(long) geteuid(), (long) getpid());
|
||||
#else
|
||||
|
Reference in New Issue
Block a user