mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-05 19:09:58 +08: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:
parent
1add0b15f1
commit
4d06f1f858
@ -965,8 +965,8 @@ connectOptions2(PGconn *conn)
|
||||
{
|
||||
conn->status = CONNECTION_BAD;
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("could not match %d host names to %d hostaddrs\n"),
|
||||
count_comma_separated_elems(conn->pghost), conn->nconnhost);
|
||||
libpq_gettext("could not match %d host names to %d hostaddrs\n"),
|
||||
count_comma_separated_elems(conn->pghost), conn->nconnhost);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1097,7 +1097,7 @@ connectOptions2(PGconn *conn)
|
||||
char *pwhost = conn->connhost[i].host;
|
||||
|
||||
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;
|
||||
|
||||
conn->connhost[i].password =
|
||||
|
Loading…
Reference in New Issue
Block a user