summaryrefslogtreecommitdiff
path: root/src/timezone/pgtz.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-04-11 14:13:31 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-05-16 08:52:39 -0400
commit47b4913050a320bfba55fa65d52d9ba15488bc70 (patch)
tree7b97d0a03104a21e0df8911cda102113982632d5 /src/timezone/pgtz.c
parent21c2c3d75e888a578176616aa1411552f43b4908 (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/timezone/pgtz.c')
-rw-r--r--src/timezone/pgtz.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c
index b2a4a2d3561..fbfadfa6f8a 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,