diff options
Diffstat (limited to 'src/bin/pg_rewind/copy_fetch.c')
-rw-r--r-- | src/bin/pg_rewind/copy_fetch.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/pg_rewind/copy_fetch.c b/src/bin/pg_rewind/copy_fetch.c index 327e7ef5411..d7ce8ef2fcb 100644 --- a/src/bin/pg_rewind/copy_fetch.c +++ b/src/bin/pg_rewind/copy_fetch.c @@ -67,14 +67,14 @@ recurse_dir(const char *datadir, const char *parentpath, while (errno = 0, (xlde = readdir(xldir)) != NULL) { struct stat fst; - char fullpath[MAXPGPATH]; - char path[MAXPGPATH]; + char fullpath[MAXPGPATH * 2]; + char path[MAXPGPATH * 2]; if (strcmp(xlde->d_name, ".") == 0 || strcmp(xlde->d_name, "..") == 0) continue; - snprintf(fullpath, MAXPGPATH, "%s/%s", fullparentpath, xlde->d_name); + snprintf(fullpath, sizeof(fullpath), "%s/%s", fullparentpath, xlde->d_name); if (lstat(fullpath, &fst) < 0) { @@ -95,9 +95,9 @@ recurse_dir(const char *datadir, const char *parentpath, } if (parentpath) - snprintf(path, MAXPGPATH, "%s/%s", parentpath, xlde->d_name); + snprintf(path, sizeof(path), "%s/%s", parentpath, xlde->d_name); else - snprintf(path, MAXPGPATH, "%s", xlde->d_name); + snprintf(path, sizeof(path), "%s", xlde->d_name); if (S_ISREG(fst.st_mode)) callback(path, FILE_TYPE_REGULAR, fst.st_size, NULL); |