mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41: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:
@ -122,7 +122,7 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
|
||||
/* Collect information about all tablespaces */
|
||||
while ((de = ReadDir(tblspcdir, "pg_tblspc")) != NULL)
|
||||
{
|
||||
char fullpath[MAXPGPATH];
|
||||
char fullpath[MAXPGPATH + 10];
|
||||
char linkpath[MAXPGPATH];
|
||||
char *relpath = NULL;
|
||||
int rllen;
|
||||
@ -831,7 +831,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;
|
||||
|
||||
@ -873,7 +873,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