summaryrefslogtreecommitdiff
path: root/src/backend/replication/basebackup.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/replication/basebackup.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/replication/basebackup.c')
-rw-r--r--src/backend/replication/basebackup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c
index 624dea3b03a..b7d732a7d8f 100644
--- a/src/backend/replication/basebackup.c
+++ b/src/backend/replication/basebackup.c
@@ -885,7 +885,7 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces,
{
DIR *dir;
struct dirent *de;
- char pathbuf[MAXPGPATH];
+ char pathbuf[MAXPGPATH * 2];
struct stat statbuf;
int64 size = 0;
@@ -937,7 +937,7 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces,
"and should not be used. "
"Try taking another online backup.")));
- snprintf(pathbuf, MAXPGPATH, "%s/%s", path, de->d_name);
+ snprintf(pathbuf, sizeof(pathbuf), "%s/%s", path, de->d_name);
/* Skip postmaster.pid and postmaster.opts in the data directory */
if (strcmp(pathbuf, "./postmaster.pid") == 0 ||