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-16 08:52:39 -0400 |
commit | 47b4913050a320bfba55fa65d52d9ba15488bc70 (patch) | |
tree | 7b97d0a03104a21e0df8911cda102113982632d5 /src/bin/pg_rewind/copy_fetch.c | |
parent | 21c2c3d75e888a578176616aa1411552f43b4908 (diff) |
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/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); |