rewind-int64-log.patch
application/octet-stream
Filename: rewind-int64-log.patch
Type: application/octet-stream
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/bin/pg_rewind/libpq_fetch.c | 9 | 2 |
diff --git a/src/bin/pg_rewind/libpq_fetch.c b/src/bin/pg_rewind/libpq_fetch.c
index a6ff4e3817..ee62c6db88 100644
--- a/src/bin/pg_rewind/libpq_fetch.c
+++ b/src/bin/pg_rewind/libpq_fetch.c
@@ -272,6 +272,7 @@ receiveFileChunks(const char *sql)
int64 chunkoff;
int chunksize;
char *chunk;
+ char chunkoff_str[32];
switch (PQresultStatus(res))
{
@@ -342,8 +343,14 @@ receiveFileChunks(const char *sql)
continue;
}
- pg_log(PG_DEBUG, "received chunk for file \"%s\", offset " INT64_FORMAT ", size %d\n",
- filename, chunkoff, chunksize);
+ /*
+ * Separate step to keep platform-dependent format code out of
+ * translatable strings. And we only test for INT64_FORMAT
+ * availability in snprintf, not fprintf.
+ */
+ snprintf(chunkoff_str, sizeof(chunkoff_str), INT64_FORMAT, chunkoff);
+ pg_log(PG_DEBUG, "received chunk for file \"%s\", offset %s, size %d\n",
+ filename, chunkoff_str, chunksize);
open_target_file(filename, false);