Don't pass NULL to fprintf, if a bogus connection string is given to pg_dump.

Back-patch to all supported branches.
This commit is contained in:
Heikki Linnakangas 2013-02-20 16:22:47 +02:00
parent 5d6899dbae
commit 2930c05634
1 changed files with 2 additions and 1 deletions

View File

@ -300,7 +300,8 @@ ConnectDatabase(Archive *AHX,
/* check to see that the backend connection was successfully made */
if (PQstatus(AH->connection) == CONNECTION_BAD)
exit_horribly(modulename, "connection to database \"%s\" failed: %s",
PQdb(AH->connection), PQerrorMessage(AH->connection));
PQdb(AH->connection) ? PQdb(AH->connection) : "",
PQerrorMessage(AH->connection));
/* check for version mismatch */
_check_database_version(AH);