mirror of
https://github.com/postgres/postgres.git
synced 2025-08-18 12:22:09 +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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user