1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Get rid of unsafe sprintf and snprintf usages. Per compiler warnings.

This commit is contained in:
Tom Lane
2010-05-14 00:32:21 +00:00
parent adf6b8edfb
commit 8eac39780d
3 changed files with 12 additions and 11 deletions

View File

@ -178,10 +178,11 @@ start_postmaster(migratorContext *ctx, Cluster whichCluster, bool quiet)
}
/* use -l for Win32 */
sprintf(cmd, SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" "
"-o \"-p %d -c autovacuum=off -c autovacuum_freeze_max_age=2000000000\" "
"start >> \"%s\" 2>&1" SYSTEMQUOTE,
bindir, ctx->logfile, datadir, port, ctx->logfile);
snprintf(cmd, sizeof(cmd),
SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" "
"-o \"-p %d -c autovacuum=off -c autovacuum_freeze_max_age=2000000000\" "
"start >> \"%s\" 2>&1" SYSTEMQUOTE,
bindir, ctx->logfile, datadir, port, ctx->logfile);
exec_prog(ctx, true, "%s", cmd);
/* wait for the server to start properly */