Skip to content

Commit 233bfe0

Browse files
committed
Fix PQconninfoParse error message handling
The returned error message already includes a newline, but the callers were adding their own when printing it out.
1 parent 4ed22e8 commit 233bfe0

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/bin/pg_basebackup/streamutil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ GetConnection(void)
5656
conn_opts = PQconninfoParse(connection_string, &err_msg);
5757
if (conn_opts == NULL)
5858
{
59-
fprintf(stderr, "%s: %s\n", progname, err_msg);
59+
fprintf(stderr, "%s: %s", progname, err_msg);
6060
exit(1);
6161
}
6262

src/bin/pg_dump/pg_dumpall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@ connectDatabase(const char *dbname, const char *connection_string,
17521752
conn_opts = PQconninfoParse(connection_string, &err_msg);
17531753
if (conn_opts == NULL)
17541754
{
1755-
fprintf(stderr, "%s: %s\n", progname, err_msg);
1755+
fprintf(stderr, "%s: %s", progname, err_msg);
17561756
exit_nicely(1);
17571757
}
17581758

src/bin/scripts/pg_isready.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ main(int argc, char **argv)
135135
opts = PQconninfoParse(pgdbname, &errmsg);
136136
if (opts == NULL)
137137
{
138-
fprintf(stderr, _("%s: %s\n"), progname, errmsg);
138+
fprintf(stderr, _("%s: %s"), progname, errmsg);
139139
exit(PQPING_NO_ATTEMPT);
140140
}
141141
}

src/interfaces/libpq/test/uri-regress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ main(int argc, char *argv[])
3333
opts = PQconninfoParse(argv[1], &errmsg);
3434
if (opts == NULL)
3535
{
36-
fprintf(stderr, "uri-regress: %s\n", errmsg);
36+
fprintf(stderr, "uri-regress: %s", errmsg);
3737
return 1;
3838
}
3939

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy