diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-04-11 14:13:31 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-05-15 13:31:42 -0400 |
commit | 7fc5615afdda0a1bae21c7d0fc47a376e7a8eda2 (patch) | |
tree | 6fd23fc7ee61f18ac91ce4edaa3738bfac02ee57 /contrib/pg_archivecleanup/pg_archivecleanup.c | |
parent | 2dca50b764d40c8cf4edeaaaf09a3292aeb7026e (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 'contrib/pg_archivecleanup/pg_archivecleanup.c')
-rw-r--r-- | contrib/pg_archivecleanup/pg_archivecleanup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pg_archivecleanup/pg_archivecleanup.c b/contrib/pg_archivecleanup/pg_archivecleanup.c index 212b267fcfa..9f97153ca0f 100644 --- a/contrib/pg_archivecleanup/pg_archivecleanup.c +++ b/contrib/pg_archivecleanup/pg_archivecleanup.c @@ -30,7 +30,7 @@ char *additional_ext = NULL; /* Extension to remove from filenames */ char *archiveLocation; /* where to find the archive? */ char *restartWALFileName; /* the file from which we can restart restore */ -char WALFilePath[MAXPGPATH]; /* the file path including archive */ +char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */ char exclusiveCleanupFileName[MAXPGPATH]; /* the oldest file we * want to remain in * archive */ @@ -133,7 +133,7 @@ CleanupPriorWALFiles(void) * extension that might have been chopped off before testing * the sequence. */ - snprintf(WALFilePath, MAXPGPATH, "%s/%s", + snprintf(WALFilePath, sizeof(WALFilePath), "%s/%s", archiveLocation, xlde->d_name); if (dryrun) |