mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Refactor sprintf calls with computed format strings into multiple calls with
constant format strings, so that the compiler can more easily check the formats for correctness.
This commit is contained in:
@ -37,7 +37,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.611 2010/06/03 21:02:11 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.612 2010/06/16 00:54:16 petere Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@ -3381,9 +3381,10 @@ BackendInitialize(Port *port)
|
||||
(errmsg_internal("pg_getnameinfo_all() failed: %s",
|
||||
gai_strerror(ret))));
|
||||
}
|
||||
snprintf(remote_ps_data, sizeof(remote_ps_data),
|
||||
remote_port[0] == '\0' ? "%s" : "%s(%s)",
|
||||
remote_host, remote_port);
|
||||
if (remote_port[0] == '\0')
|
||||
snprintf(remote_ps_data, sizeof(remote_ps_data), "%s", remote_host);
|
||||
else
|
||||
snprintf(remote_ps_data, sizeof(remote_ps_data), "%s(%s)", remote_host, remote_port);
|
||||
|
||||
if (Log_connections)
|
||||
{
|
||||
|
Reference in New Issue
Block a user