summaryrefslogtreecommitdiff
path: root/src/backend/postmaster
diff options
context:
space:
mode:
authorPeter Eisentraut2017-04-11 18:13:31 +0000
committerPeter Eisentraut2017-04-17 17:59:46 +0000
commit6275f5d28a1577563f53f2171689d4f890a46881 (patch)
tree5195747800c596ab9151a86a322a7698d0bec393 /src/backend/postmaster
parent0e8286d354520cd8b8ac5e7a963130769f731476 (diff)
Fix new warnings from GCC 7
This addresses the new warning types -Wformat-truncation -Wformat-overflow that are part of -Wall, via -Wformat, in GCC 7.
Diffstat (limited to 'src/backend/postmaster')
-rw-r--r--src/backend/postmaster/pgstat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 235dc264055..15d06892d3a 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -606,7 +606,7 @@ pgstat_reset_remove_files(const char *directory)
{
DIR *dir;
struct dirent *entry;
- char fname[MAXPGPATH];
+ char fname[MAXPGPATH * 2];
dir = AllocateDir(directory);
while ((entry = ReadDir(dir, directory)) != NULL)
@@ -636,7 +636,7 @@ pgstat_reset_remove_files(const char *directory)
strcmp(entry->d_name + nchars, "stat") != 0)
continue;
- snprintf(fname, MAXPGPATH, "%s/%s", directory,
+ snprintf(fname, sizeof(fname), "%s/%s", directory,
entry->d_name);
unlink(fname);
}