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-15 13:31:42 -0400 |
commit | 7fc5615afdda0a1bae21c7d0fc47a376e7a8eda2 (patch) | |
tree | 6fd23fc7ee61f18ac91ce4edaa3738bfac02ee57 /src/backend/replication/slot.c | |
parent | 2dca50b764d40c8cf4edeaaaf09a3292aeb7026e (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/backend/replication/slot.c')
-rw-r--r-- | src/backend/replication/slot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index f108979e6f1..7f04b22d2d6 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -860,13 +860,13 @@ StartupReplicationSlots(void) while ((replication_de = ReadDir(replication_dir, "pg_replslot")) != NULL) { struct stat statbuf; - char path[MAXPGPATH]; + char path[MAXPGPATH + 12]; if (strcmp(replication_de->d_name, ".") == 0 || strcmp(replication_de->d_name, "..") == 0) continue; - snprintf(path, MAXPGPATH, "pg_replslot/%s", replication_de->d_name); + snprintf(path, sizeof(path), "pg_replslot/%s", replication_de->d_name); /* we're only creating directories here, skip if it's not our's */ if (lstat(path, &statbuf) == 0 && !S_ISDIR(statbuf.st_mode)) @@ -1098,7 +1098,7 @@ RestoreSlotFromDisk(const char *name) { ReplicationSlotOnDisk cp; int i; - char path[MAXPGPATH]; + char path[MAXPGPATH + 22]; int fd; bool restored = false; int readBytes; |