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/storage/ipc/dsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/storage/ipc/dsm.c') diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c index 47f2bea0be3..8affe6711de 100644 --- a/src/backend/storage/ipc/dsm.c +++ b/src/backend/storage/ipc/dsm.c @@ -306,9 +306,9 @@ dsm_cleanup_for_mmap(void) if (strncmp(dent->d_name, PG_DYNSHMEM_MMAP_FILE_PREFIX, strlen(PG_DYNSHMEM_MMAP_FILE_PREFIX)) == 0) { - char buf[MAXPGPATH]; + char buf[MAXPGPATH + sizeof(PG_DYNSHMEM_DIR)]; - snprintf(buf, MAXPGPATH, PG_DYNSHMEM_DIR "/%s", dent->d_name); + snprintf(buf, sizeof(buf), PG_DYNSHMEM_DIR "/%s", dent->d_name); elog(DEBUG2, "removing file \"%s\"", buf); -- cgit v1.2.3