summaryrefslogtreecommitdiff
path: root/src/backend/utils/time/snapmgr.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:43:55 -0400
commit14605156180a424ba519e7058e34af51d641bffd (patch)
tree0a52fb7e530aa1a91a6c1ae1ac8f25343d3ec8cf /src/backend/utils/time/snapmgr.c
parentce80240a7d3a0732cf36fe5068e5899a89c1f7ff (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/utils/time/snapmgr.c')
-rw-r--r--src/backend/utils/time/snapmgr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index a6264c7e203..f68a15b90b6 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -1417,7 +1417,7 @@ XactHasExportedSnapshots(void)
void
DeleteAllExportedSnapshotFiles(void)
{
- char buf[MAXPGPATH];
+ char buf[MAXPGPATH + sizeof(SNAPSHOT_EXPORT_DIR)];
DIR *s_dir;
struct dirent *s_de;
@@ -1438,7 +1438,7 @@ DeleteAllExportedSnapshotFiles(void)
strcmp(s_de->d_name, "..") == 0)
continue;
- snprintf(buf, MAXPGPATH, SNAPSHOT_EXPORT_DIR "/%s", s_de->d_name);
+ snprintf(buf, sizeof(buf), SNAPSHOT_EXPORT_DIR "/%s", s_de->d_name);
/* Again, unlink failure is not worthy of FATAL */
if (unlink(buf))
elog(LOG, "could not unlink file \"%s\": %m", buf);