From 7fc5615afdda0a1bae21c7d0fc47a376e7a8eda2 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 11 Apr 2017 14:13:31 -0400 Subject: 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. --- src/backend/postmaster/pgstat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/postmaster/pgstat.c') diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 085b94acfe7..e4cc0dc3521 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -567,7 +567,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) @@ -597,7 +597,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); } -- cgit v1.2.3