From 47b4913050a320bfba55fa65d52d9ba15488bc70 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 11 Apr 2017 14:13:31 -0400 Subject: 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. --- src/backend/access/heap/rewriteheap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/access/heap/rewriteheap.c') diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c index 300b075af75..674b1bd2e63 100644 --- a/src/backend/access/heap/rewriteheap.c +++ b/src/backend/access/heap/rewriteheap.c @@ -1194,7 +1194,7 @@ CheckPointLogicalRewriteHeap(void) XLogRecPtr redo; DIR *mappings_dir; struct dirent *mapping_de; - char path[MAXPGPATH]; + char path[MAXPGPATH + 20]; /* * We start of with a minimum of the last redo pointer. No new decoding @@ -1225,7 +1225,7 @@ CheckPointLogicalRewriteHeap(void) strcmp(mapping_de->d_name, "..") == 0) continue; - snprintf(path, MAXPGPATH, "pg_logical/mappings/%s", mapping_de->d_name); + snprintf(path, sizeof(path), "pg_logical/mappings/%s", mapping_de->d_name); if (lstat(path, &statbuf) == 0 && !S_ISREG(statbuf.st_mode)) continue; -- cgit v1.2.3