aboutsummaryrefslogtreecommitdiff
path: root/src/backend/bootstrap/bootstrap.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2013-10-13 00:09:18 -0400
committerPeter Eisentraut <peter_e@gmx.net>2013-10-13 00:09:18 -0400
commit5b6d08cd2992922b667564a49f19580f11676050 (patch)
tree4104a4255eeb88e78da71477b5f7b129f9a1b599 /src/backend/bootstrap/bootstrap.c
parenta53dee43fe585e673658b01e7354892dcede957e (diff)
downloadpostgresql-5b6d08cd2992922b667564a49f19580f11676050.tar.gz
postgresql-5b6d08cd2992922b667564a49f19580f11676050.zip
Add use of asprintf()
Add asprintf(), pg_asprintf(), and psprintf() to simplify string allocation and composition. Replacement implementations taken from NetBSD. Reviewed-by: Álvaro Herrera <alvherre@2ndquadrant.com> Reviewed-by: Asif Naeem <anaeem.it@gmail.com>
Diffstat (limited to 'src/backend/bootstrap/bootstrap.c')
-rw-r--r--src/backend/bootstrap/bootstrap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index d23dc4504ae..2a1af63d781 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -249,9 +249,9 @@ AuxiliaryProcessMain(int argc, char *argv[])
case 'd':
{
/* Turn on debugging for the bootstrap process. */
- char *debugstr = palloc(strlen("debug") + strlen(optarg) + 1);
+ char *debugstr;
- sprintf(debugstr, "debug%s", optarg);
+ debugstr = psprintf("debug%s", optarg);
SetConfigOption("log_min_messages", debugstr,
PGC_POSTMASTER, PGC_S_ARGV);
SetConfigOption("client_min_messages", debugstr,