From 6275f5d28a1577563f53f2171689d4f890a46881 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/common/file_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/file_utils.c') diff --git a/src/common/file_utils.c b/src/common/file_utils.c index 72b0565c710..218b83f3913 100644 --- a/src/common/file_utils.c +++ b/src/common/file_utils.c @@ -166,7 +166,7 @@ walkdir(const char *path, while (errno = 0, (de = readdir(dir)) != NULL) { - char subpath[MAXPGPATH]; + char subpath[MAXPGPATH * 2]; struct stat fst; int sret; @@ -174,7 +174,7 @@ walkdir(const char *path, strcmp(de->d_name, "..") == 0) continue; - snprintf(subpath, MAXPGPATH, "%s/%s", path, de->d_name); + snprintf(subpath, sizeof(subpath), "%s/%s", path, de->d_name); if (process_symlinks) sret = stat(subpath, &fst); -- cgit v1.2.3