@@ -949,7 +949,7 @@ mkdatadir(const char *subdir)
949949 char * path ;
950950
951951 if (subdir )
952- pg_asprintf ( & path , "%s/%s" , pg_data , subdir );
952+ path = psprintf ( "%s/%s" , pg_data , subdir );
953953 else
954954 path = pg_strdup (pg_data );
955955
@@ -969,7 +969,7 @@ mkdatadir(const char *subdir)
969969static void
970970set_input (char * * dest , char * filename )
971971{
972- pg_asprintf ( dest , "%s/%s" , share_path , filename );
972+ * dest = psprintf ( "%s/%s" , share_path , filename );
973973}
974974
975975/*
@@ -1023,9 +1023,9 @@ write_version_file(char *extrapath)
10231023 char * path ;
10241024
10251025 if (extrapath == NULL )
1026- pg_asprintf ( & path , "%s/PG_VERSION" , pg_data );
1026+ path = psprintf ( "%s/PG_VERSION" , pg_data );
10271027 else
1028- pg_asprintf ( & path , "%s/%s/PG_VERSION" , pg_data , extrapath );
1028+ path = psprintf ( "%s/%s/PG_VERSION" , pg_data , extrapath );
10291029
10301030 if ((version_file = fopen (path , PG_BINARY_W )) == NULL )
10311031 {
@@ -1053,7 +1053,7 @@ set_null_conf(void)
10531053 FILE * conf_file ;
10541054 char * path ;
10551055
1056- pg_asprintf ( & path , "%s/postgresql.conf" , pg_data );
1056+ path = psprintf ( "%s/postgresql.conf" , pg_data );
10571057 conf_file = fopen (path , PG_BINARY_W );
10581058 if (conf_file == NULL )
10591059 {
@@ -2951,7 +2951,7 @@ setup_pgdata(void)
29512951 * need quotes otherwise on Windows because paths there are most likely to
29522952 * have embedded spaces.
29532953 */
2954- pg_asprintf ( & pgdata_set_env , "PGDATA=%s" , pg_data );
2954+ pgdata_set_env = psprintf ( "PGDATA=%s" , pg_data );
29552955 putenv (pgdata_set_env );
29562956}
29572957
@@ -3345,7 +3345,7 @@ create_xlog_symlink(void)
33453345 }
33463346
33473347 /* form name of the place where the symlink must go */
3348- pg_asprintf ( & linkloc , "%s/pg_xlog" , pg_data );
3348+ linkloc = psprintf ( "%s/pg_xlog" , pg_data );
33493349
33503350#ifdef HAVE_SYMLINK
33513351 if (symlink (xlog_dir , linkloc ) != 0 )
0 commit comments