]> granicus.if.org Git - postgresql/commitdiff
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 7f890569d3b4f56231ed77a51cbdac4e5d5dc99e..654b7cefbcef1cac0a33c2e2c80648b52c54c1ea 100644 (file)
@@ -28,7 +28,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- *  $Id: pqcomm.c,v 1.68 1999/04/25 03:19:21 tgl Exp $
+ *  $Id: pqcomm.c,v 1.69 1999/05/04 23:39:20 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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
                {