aboutsummaryrefslogtreecommitdiff
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-04-17 13:59:46 -0400
commit6275f5d28a1577563f53f2171689d4f890a46881 (patch)
tree5195747800c596ab9151a86a322a7698d0bec393 /src/backend/access/transam/xlog.c
parent0e8286d354520cd8b8ac5e7a963130769f731476 (diff)
downloadpostgresql-6275f5d28a1577563f53f2171689d4f890a46881.tar.gz
postgresql-6275f5d28a1577563f53f2171689d4f890a46881.zip
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 45ed58ea343..c7667879c65 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -4102,7 +4102,7 @@ CleanupBackupHistory(void)
{
DIR *xldir;
struct dirent *xlde;
- char path[MAXPGPATH];
+ char path[MAXPGPATH + sizeof(XLOGDIR)];
xldir = AllocateDir(XLOGDIR);
if (xldir == NULL)
@@ -4120,7 +4120,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);
}
@@ -10389,7 +10389,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
/* Collect information about all tablespaces */
while ((de = ReadDir(tblspcdir, "pg_tblspc")) != NULL)
{
- char fullpath[MAXPGPATH];
+ char fullpath[MAXPGPATH + 10];
char linkpath[MAXPGPATH];
char *relpath = NULL;
int rllen;