1
0
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:
Peter Eisentraut
2017-04-11 14:13:31 -04:00
parent ce80240a7d
commit 1460515618
22 changed files with 65 additions and 65 deletions

View File

@@ -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 ||