1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +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

@ -62,10 +62,10 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
#else
SetEnvironmentVariableA("LANG", "C");
#endif
sprintf(cmd, SYSTEMQUOTE "\"%s/%s \"%s\"" SYSTEMQUOTE,
cluster->bindir,
live_check ? "pg_controldata\"" : "pg_resetxlog\" -n",
cluster->pgdata);
snprintf(cmd, sizeof(cmd), SYSTEMQUOTE "\"%s/%s \"%s\"" SYSTEMQUOTE,
cluster->bindir,
live_check ? "pg_controldata\"" : "pg_resetxlog\" -n",
cluster->pgdata);
fflush(stdout);
fflush(stderr);