aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/copydir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/file/copydir.c')
-rw-r--r--src/backend/storage/file/copydir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/storage/file/copydir.c b/src/backend/storage/file/copydir.c
index a51ee815662..a964e47f502 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