summaryrefslogtreecommitdiff
path: root/src/bin/initdb/initdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/initdb/initdb.c')
-rw-r--r--src/bin/initdb/initdb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index f7073e26bd7..3983b237313 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -949,7 +949,7 @@ mkdatadir(const char *subdir)
char *path;
if (subdir)
- pg_asprintf(&path, "%s/%s", pg_data, subdir);
+ path = psprintf("%s/%s", pg_data, subdir);
else
path = pg_strdup(pg_data);
@@ -969,7 +969,7 @@ mkdatadir(const char *subdir)
static void
set_input(char **dest, char *filename)
{
- pg_asprintf(dest, "%s/%s", share_path, filename);
+ *dest = psprintf("%s/%s", share_path, filename);
}
/*
@@ -1023,9 +1023,9 @@ write_version_file(char *extrapath)
char *path;
if (extrapath == NULL)
- pg_asprintf(&path, "%s/PG_VERSION", pg_data);
+ path = psprintf("%s/PG_VERSION", pg_data);
else
- pg_asprintf(&path, "%s/%s/PG_VERSION", pg_data, extrapath);
+ path = psprintf("%s/%s/PG_VERSION", pg_data, extrapath);
if ((version_file = fopen(path, PG_BINARY_W)) == NULL)
{
@@ -1053,7 +1053,7 @@ set_null_conf(void)
FILE *conf_file;
char *path;
- pg_asprintf(&path, "%s/postgresql.conf", pg_data);
+ path = psprintf("%s/postgresql.conf", pg_data);
conf_file = fopen(path, PG_BINARY_W);
if (conf_file == NULL)
{
@@ -2951,7 +2951,7 @@ setup_pgdata(void)
* need quotes otherwise on Windows because paths there are most likely to
* have embedded spaces.
*/
- pg_asprintf(&pgdata_set_env, "PGDATA=%s", pg_data);
+ pgdata_set_env = psprintf("PGDATA=%s", pg_data);
putenv(pgdata_set_env);
}
@@ -3345,7 +3345,7 @@ create_xlog_symlink(void)
}
/* form name of the place where the symlink must go */
- pg_asprintf(&linkloc, "%s/pg_xlog", pg_data);
+ linkloc = psprintf("%s/pg_xlog", pg_data);
#ifdef HAVE_SYMLINK
if (symlink(xlog_dir, linkloc) != 0)