summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.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-15 13:31:42 -0400
commit7fc5615afdda0a1bae21c7d0fc47a376e7a8eda2 (patch)
tree6fd23fc7ee61f18ac91ce4edaa3738bfac02ee57 /src/backend/access/transam/xlog.c
parent2dca50b764d40c8cf4edeaaaf09a3292aeb7026e (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/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index d8f3d5c5170..17a26926599 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -3987,7 +3987,7 @@ CleanupBackupHistory(void)
{
DIR *xldir;
struct dirent *xlde;
- char path[MAXPGPATH];
+ char path[MAXPGPATH + sizeof(XLOGDIR)];
xldir = AllocateDir(XLOGDIR);
if (xldir == NULL)
@@ -4008,7 +4008,7 @@ CleanupBackupHistory(void)
ereport(DEBUG2,
(errmsg("removing transaction log backup history file \"%s\"",
xlde->d_name)));
- snprintf(path, MAXPGPATH, XLOGDIR "/%s", xlde->d_name);
+ snprintf(path, sizeof(path), XLOGDIR "/%s", xlde->d_name);
unlink(path);
XLogArchiveCleanup(xlde->d_name);
}