From: Muhammad Usama Date: Mon, 30 Sep 2019 09:55:06 +0000 (+0500) Subject: Fixing a compiler warning and a tiny coding mistake X-Git-Tag: V4_2_0_ALPHA1~274 X-Git-Url: http://git.postgresql.org/gitweb/static/help.php?a=commitdiff_plain;h=362bddd9c09efad52e543c363804d462c39d3b0f;p=pgpool2.git Fixing a compiler warning and a tiny coding mistake --- diff --git a/src/tools/pcp/pcp_frontend_client.c b/src/tools/pcp/pcp_frontend_client.c index b9f7bc578..fa8155725 100644 --- a/src/tools/pcp/pcp_frontend_client.c +++ b/src/tools/pcp/pcp_frontend_client.c @@ -873,7 +873,7 @@ format_titles(const char **titles, const char **types, int ntitles) snprintf(buf, sizeof(buf), "%%-%ds : %%%%%s", maxlen, types[i]); snprintf(buf2, sizeof(buf2), buf, titles[i], types[i]); - strncat(formatbuf, buf2, sizeof(buf2)); + strncat(formatbuf, buf2, sizeof(formatbuf) - strlen(formatbuf) - 2); strcat(formatbuf, "\n"); } return formatbuf; diff --git a/src/utils/psprintf.c b/src/utils/psprintf.c index 7dba828e4..7eba81d4b 100644 --- a/src/utils/psprintf.c +++ b/src/utils/psprintf.c @@ -26,7 +26,7 @@ #include "utils/memutils.h" #else - +#include #include "utils/fe_ports.h" /* It's possible we could use a different value for this in frontend code */