mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Fix check for empty hostname.
As reported by Arthur Zakirov, Gcc 7.1 complained about this with -Wpointer-compare. Discussion: https://www.postgresql.org/message-id/CAKNkYnybV_NFVacGbW=VspzAo3TwRJFNi+9iBob66YqQMZopwg@mail.gmail.com
This commit is contained in:
@ -965,8 +965,8 @@ connectOptions2(PGconn *conn)
|
|||||||
{
|
{
|
||||||
conn->status = CONNECTION_BAD;
|
conn->status = CONNECTION_BAD;
|
||||||
printfPQExpBuffer(&conn->errorMessage,
|
printfPQExpBuffer(&conn->errorMessage,
|
||||||
libpq_gettext("could not match %d host names to %d hostaddrs\n"),
|
libpq_gettext("could not match %d host names to %d hostaddrs\n"),
|
||||||
count_comma_separated_elems(conn->pghost), conn->nconnhost);
|
count_comma_separated_elems(conn->pghost), conn->nconnhost);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1097,7 +1097,7 @@ connectOptions2(PGconn *conn)
|
|||||||
char *pwhost = conn->connhost[i].host;
|
char *pwhost = conn->connhost[i].host;
|
||||||
|
|
||||||
if (conn->connhost[i].type == CHT_HOST_ADDRESS &&
|
if (conn->connhost[i].type == CHT_HOST_ADDRESS &&
|
||||||
conn->connhost[i].host != NULL && conn->connhost[i].host != '\0')
|
conn->connhost[i].host != NULL && conn->connhost[i].host[0] != '\0')
|
||||||
pwhost = conn->connhost[i].hostaddr;
|
pwhost = conn->connhost[i].hostaddr;
|
||||||
|
|
||||||
conn->connhost[i].password =
|
conn->connhost[i].password =
|
||||||
|
Reference in New Issue
Block a user