mirror of
https://github.com/postgres/postgres.git
synced 2025-08-19 23:22:23 +03:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user