]> granicus.if.org Git - postgresql/commitdiff
Fix PQconninfoParse error message handling
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 16 Jul 2013 00:04:14 +0000 (20:04 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 16 Jul 2013 00:04:14 +0000 (20:04 -0400)
The returned error message already includes a newline, but the callers
were adding their own when printing it out.

src/bin/pg_basebackup/streamutil.c
src/bin/pg_dump/pg_dumpall.c
src/bin/scripts/pg_isready.c
src/interfaces/libpq/test/uri-regress.c

index dab0e5470cfb7d308b53205f7a2890c64d35fd78..1dfb80f4a72a5e3d6e2fada9d24e25f8e6f93829 100644 (file)
@@ -56,7 +56,7 @@ GetConnection(void)
                conn_opts = PQconninfoParse(connection_string, &err_msg);
                if (conn_opts == NULL)
                {
-                       fprintf(stderr, "%s: %s\n", progname, err_msg);
+                       fprintf(stderr, "%s: %s", progname, err_msg);
                        exit(1);
                }
 
index 78f702f897309511218b019a7dd99fac9e92b597..12533073d810894afef1afc8fa2431b3d5e894cd 100644 (file)
@@ -1752,7 +1752,7 @@ connectDatabase(const char *dbname, const char *connection_string,
                        conn_opts = PQconninfoParse(connection_string, &err_msg);
                        if (conn_opts == NULL)
                        {
-                               fprintf(stderr, "%s: %s\n", progname, err_msg);
+                               fprintf(stderr, "%s: %s", progname, err_msg);
                                exit_nicely(1);
                        }
 
index 5cb75a42ec01220b7c2d49e0c953ffe26406cd83..d27ccea70fbf3626eb4ff3440f6595e0b79c53d8 100644 (file)
@@ -135,7 +135,7 @@ main(int argc, char **argv)
                opts = PQconninfoParse(pgdbname, &errmsg);
                if (opts == NULL)
                {
-                       fprintf(stderr, _("%s: %s\n"), progname, errmsg);
+                       fprintf(stderr, _("%s: %s"), progname, errmsg);
                        exit(PQPING_NO_ATTEMPT);
                }
        }
index 6e1e3506fce836960ae01b1ee3cce387afac8ece..00acd64a5f0f6a0f5ba02da2b44467974fd6475f 100644 (file)
@@ -33,7 +33,7 @@ main(int argc, char *argv[])
        opts = PQconninfoParse(argv[1], &errmsg);
        if (opts == NULL)
        {
-               fprintf(stderr, "uri-regress: %s\n", errmsg);
+               fprintf(stderr, "uri-regress: %s", errmsg);
                return 1;
        }