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:
@@ -885,7 +885,7 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces,
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *de;
|
||||
char pathbuf[MAXPGPATH];
|
||||
char pathbuf[MAXPGPATH * 2];
|
||||
struct stat statbuf;
|
||||
int64 size = 0;
|
||||
|
||||
@@ -937,7 +937,7 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces,
|
||||
"and should not be used. "
|
||||
"Try taking another online backup.")));
|
||||
|
||||
snprintf(pathbuf, MAXPGPATH, "%s/%s", path, de->d_name);
|
||||
snprintf(pathbuf, sizeof(pathbuf), "%s/%s", path, de->d_name);
|
||||
|
||||
/* Skip postmaster.pid and postmaster.opts in the data directory */
|
||||
if (strcmp(pathbuf, "./postmaster.pid") == 0 ||
|
||||
|
Reference in New Issue
Block a user