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/timezone/pgtz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/timezone/pgtz.c') diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c index 73fecb381ba..6a7c9816d82 100644 --- a/src/timezone/pgtz.c +++ b/src/timezone/pgtz.c @@ -437,7 +437,7 @@ pg_tzenumerate_next(pg_tzenum *dir) while (dir->depth >= 0) { struct dirent *direntry; - char fullname[MAXPGPATH]; + char fullname[MAXPGPATH * 2]; struct stat statbuf; direntry = ReadDir(dir->dirdesc[dir->depth], dir->dirname[dir->depth]); @@ -454,7 +454,7 @@ pg_tzenumerate_next(pg_tzenum *dir) if (direntry->d_name[0] == '.') continue; - snprintf(fullname, MAXPGPATH, "%s/%s", + snprintf(fullname, sizeof(fullname), "%s/%s", dir->dirname[dir->depth], direntry->d_name); if (stat(fullname, &statbuf) != 0) ereport(ERROR, -- cgit v1.2.3