Fix incorrect format placeholders in walreceiver.c

Started by Yongtao Huangalmost 2 years ago2 messages
#1Yongtao Huang
yongtaoh2022@gmail.com
1 attachment(s)

Hi all,

I think the correct placeholder for var *startoff* should be *%d*.
Thanks for your time.

Best

Yongtao Huang

Attachments:

0001-Fix-incorrect-format-placeholders-in-walreceiver.c.patchapplication/octet-stream; name=0001-Fix-incorrect-format-placeholders-in-walreceiver.c.patchDownload
From a1b1d7b1f9b80628c425d151800ea5555aff0063 Mon Sep 17 00:00:00 2001
From: Yongtao Huang <yongtah2022@gmail.com>
Date: Thu, 18 Jan 2024 21:25:14 +0800
Subject: [PATCH] Fix incorrect format placeholders in walreceiver.c

---
 src/backend/replication/walreceiver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c
index e00395f..7280595 100644
--- a/src/backend/replication/walreceiver.c
+++ b/src/backend/replication/walreceiver.c
@@ -955,7 +955,7 @@ XLogWalRcvWrite(char *buf, Size nbytes, XLogRecPtr recptr, TimeLineID tli)
 			ereport(PANIC,
 					(errcode_for_file_access(),
 					 errmsg("could not write to WAL segment %s "
-							"at offset %u, length %lu: %m",
+							"at offset %d, length %lu: %m",
 							xlogfname, startoff, (unsigned long) segbytes)));
 		}
 
-- 
1.8.3.1

#2Michael Paquier
michael@paquier.xyz
In reply to: Yongtao Huang (#1)
Re: Fix incorrect format placeholders in walreceiver.c

On Thu, Jan 18, 2024 at 09:32:55PM +0800, Yongtao Huang wrote:

I think the correct placeholder for var *startoff* should be *%d*.
Thanks for your time.

Thanks, fixed.
--
Michael