1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-25 12:03:53 +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:
Peter Eisentraut
2017-04-11 14:13:31 -04:00
parent 0e8286d354
commit 6275f5d28a
23 changed files with 68 additions and 68 deletions

View File

@@ -606,7 +606,7 @@ pgstat_reset_remove_files(const char *directory)
{
DIR *dir;
struct dirent *entry;
char fname[MAXPGPATH];
char fname[MAXPGPATH * 2];
dir = AllocateDir(directory);
while ((entry = ReadDir(dir, directory)) != NULL)
@@ -636,7 +636,7 @@ pgstat_reset_remove_files(const char *directory)
strcmp(entry->d_name + nchars, "stat") != 0)
continue;
snprintf(fname, MAXPGPATH, "%s/%s", directory,
snprintf(fname, sizeof(fname), "%s/%s", directory,
entry->d_name);
unlink(fname);
}