summaryrefslogtreecommitdiff
path: root/src/bin/pg_rewind/libpq_fetch.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2019-06-06 14:14:29 +0200
committerPeter Eisentraut <peter@eisentraut.org>2019-07-04 17:01:43 +0200
commit6a1cd8b9236dcfa91b40af3a8337859e16ba7113 (patch)
treed28df515cafc7354c03588285edf9b1e7ad7656d /src/bin/pg_rewind/libpq_fetch.c
parent7b925e12703652fef63a2fbbb28d3407b2971d6e (diff)
downloadpostgresql-6a1cd8b9236dcfa91b40af3a8337859e16ba7113.tar.gz
Unwind some workarounds for lack of portable int64 format specifier
Because there is no portable int64/uint64 format specifier and we can't stick macros like INT64_FORMAT into the middle of a translatable string, we have been using various workarounds that put the number to be printed into a string buffer first. Now that we always use our own sprintf(), we can rely on %lld and %llu to work, so we can use those. This patch undoes this workaround in a few places where it was egregiously verbose. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/CAH2-Wz%3DWbNxc5ob5NJ9yqo2RMJ0q4HXDS30GVCobeCvC9A1L9A%40mail.gmail.com
Diffstat (limited to 'src/bin/pg_rewind/libpq_fetch.c')
-rw-r--r--src/bin/pg_rewind/libpq_fetch.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/bin/pg_rewind/libpq_fetch.c b/src/bin/pg_rewind/libpq_fetch.c
index d6cbe23926..37eccc3126 100644
--- a/src/bin/pg_rewind/libpq_fetch.c
+++ b/src/bin/pg_rewind/libpq_fetch.c
@@ -251,7 +251,6 @@ receiveFileChunks(const char *sql)
char *filename;
int filenamelen;
int64 chunkoff;
- char chunkoff_str[32];
int chunksize;
char *chunk;
@@ -327,13 +326,8 @@ receiveFileChunks(const char *sql)
continue;
}
- /*
- * Separate step to keep platform-dependent format code out of
- * translatable strings.
- */
- snprintf(chunkoff_str, sizeof(chunkoff_str), INT64_FORMAT, chunkoff);
- pg_log_debug("received chunk for file \"%s\", offset %s, size %d",
- filename, chunkoff_str, chunksize);
+ pg_log_debug("received chunk for file \"%s\", offset %lld, size %d",
+ filename, (long long int) chunkoff, chunksize);
open_target_file(filename, false);