From 362bddd9c09efad52e543c363804d462c39d3b0f Mon Sep 17 00:00:00 2001 From: Muhammad Usama Date: Mon, 30 Sep 2019 14:55:06 +0500 Subject: [PATCH] Fixing a compiler warning and a tiny coding mistake --- src/tools/pcp/pcp_frontend_client.c | 2 +- src/utils/psprintf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 */ -- 2.39.5