From c55aa41201838ff87ce671c683e787ed2f4ff480 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 4 May 1999 23:39:20 +0000 Subject: [PATCH] Repair incorrectly-figured snprintf length restriction. --- src/backend/libpq/pqcomm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 9401c4c9ed..38e1181c84 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -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 { -- 2.39.5