diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-04-11 14:13:31 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-05-15 13:31:42 -0400 |
commit | 7fc5615afdda0a1bae21c7d0fc47a376e7a8eda2 (patch) | |
tree | 6fd23fc7ee61f18ac91ce4edaa3738bfac02ee57 /src/backend/storage/file/copydir.c | |
parent | 2dca50b764d40c8cf4edeaaaf09a3292aeb7026e (diff) | |
download | postgresql-7fc5615afdda0a1bae21c7d0fc47a376e7a8eda2.tar.gz postgresql-7fc5615afdda0a1bae21c7d0fc47a376e7a8eda2.zip |
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.
Diffstat (limited to 'src/backend/storage/file/copydir.c')
-rw-r--r-- | src/backend/storage/file/copydir.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/storage/file/copydir.c b/src/backend/storage/file/copydir.c index e17b8947ef7..48d5dee797b 100644 --- a/src/backend/storage/file/copydir.c +++ b/src/backend/storage/file/copydir.c @@ -38,8 +38,8 @@ copydir(char *fromdir, char *todir, bool recurse) { DIR *xldir; struct dirent *xlde; - char fromfile[MAXPGPATH]; - char tofile[MAXPGPATH]; + char fromfile[MAXPGPATH * 2]; + char tofile[MAXPGPATH * 2]; if (mkdir(todir, S_IRWXU) != 0) ereport(ERROR, @@ -63,8 +63,8 @@ copydir(char *fromdir, char *todir, bool recurse) strcmp(xlde->d_name, "..") == 0) continue; - snprintf(fromfile, MAXPGPATH, "%s/%s", fromdir, xlde->d_name); - snprintf(tofile, MAXPGPATH, "%s/%s", todir, xlde->d_name); + snprintf(fromfile, sizeof(fromfile), "%s/%s", fromdir, xlde->d_name); + snprintf(tofile, sizeof(tofile), "%s/%s", todir, xlde->d_name); if (lstat(fromfile, &fst) < 0) ereport(ERROR, @@ -103,7 +103,7 @@ copydir(char *fromdir, char *todir, bool recurse) strcmp(xlde->d_name, "..") == 0) continue; - snprintf(tofile, MAXPGPATH, "%s/%s", todir, xlde->d_name); + snprintf(tofile, sizeof(tofile), "%s/%s", todir, xlde->d_name); /* * We don't need to sync subdirectories here since the recursive |