Repair incorrectly-figured snprintf length restriction.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 4 May 1999 23:39:20 +0000 (23:39 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 4 May 1999 23:39:20 +0000 (23:39 +0000)
src/backend/libpq/pqcomm.c

index 9401c4c9ed0ef6032ec74df4ee26102c637b1786..38e1181c845c6a3e8a13b2dab358ca342c7938c9 100644 (file)
@@ -261,8 +261,10 @@ StreamServerPort(char *hostName, short portName, int *fdP)
                           "\tIs another postmaster already running on that port?\n");
                if (family == AF_UNIX)
                {
-                       snprintf(PQerrormsg + strlen(PQerrormsg), ERROR_MSG_LENGTH,
-                                       "\tIf not, remove socket node (%s) and retry.\n", sock_path);
+                       snprintf(PQerrormsg + strlen(PQerrormsg),
+                                        ERROR_MSG_LENGTH - strlen(PQerrormsg),
+                                        "\tIf not, remove socket node (%s) and retry.\n",
+                                        sock_path);
                }
                else
                {