Commit 233bfe06 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix PQconninfoParse error message handling

The returned error message already includes a newline, but the callers
were adding their own when printing it out.
parent 4ed22e89
...@@ -56,7 +56,7 @@ GetConnection(void) ...@@ -56,7 +56,7 @@ GetConnection(void)
conn_opts = PQconninfoParse(connection_string, &err_msg); conn_opts = PQconninfoParse(connection_string, &err_msg);
if (conn_opts == NULL) if (conn_opts == NULL)
{ {
fprintf(stderr, "%s: %s\n", progname, err_msg); fprintf(stderr, "%s: %s", progname, err_msg);
exit(1); exit(1);
} }
......
...@@ -1752,7 +1752,7 @@ connectDatabase(const char *dbname, const char *connection_string, ...@@ -1752,7 +1752,7 @@ connectDatabase(const char *dbname, const char *connection_string,
conn_opts = PQconninfoParse(connection_string, &err_msg); conn_opts = PQconninfoParse(connection_string, &err_msg);
if (conn_opts == NULL) if (conn_opts == NULL)
{ {
fprintf(stderr, "%s: %s\n", progname, err_msg); fprintf(stderr, "%s: %s", progname, err_msg);
exit_nicely(1); exit_nicely(1);
} }
......
...@@ -135,7 +135,7 @@ main(int argc, char **argv) ...@@ -135,7 +135,7 @@ main(int argc, char **argv)
opts = PQconninfoParse(pgdbname, &errmsg); opts = PQconninfoParse(pgdbname, &errmsg);
if (opts == NULL) if (opts == NULL)
{ {
fprintf(stderr, _("%s: %s\n"), progname, errmsg); fprintf(stderr, _("%s: %s"), progname, errmsg);
exit(PQPING_NO_ATTEMPT); exit(PQPING_NO_ATTEMPT);
} }
} }
......
...@@ -33,7 +33,7 @@ main(int argc, char *argv[]) ...@@ -33,7 +33,7 @@ main(int argc, char *argv[])
opts = PQconninfoParse(argv[1], &errmsg); opts = PQconninfoParse(argv[1], &errmsg);
if (opts == NULL) if (opts == NULL)
{ {
fprintf(stderr, "uri-regress: %s\n", errmsg); fprintf(stderr, "uri-regress: %s", errmsg);
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment