libpq: Fix PQtrace() format for non-printable characters

Michael Paquier <michael@paquier.xyz>

Commit: 701a0bd56aa4c3091c7c92d235ada9ba7161e7e9
Author: Michael Paquier <michael@paquier.xyz>
Date: 2025-09-03T03:54:31Z
Releases: 16.11
libpq: Fix PQtrace() format for non-printable characters

PQtrace() was generating its output for non-printable characters without
casting the characters printed with unsigned char, leading to some extra
"\xffffff" generated in the output due to the fact that char may be
signed.

Oversights introduced by commit 198b3716dba6, so backpatch down to v14.

Author: Ran Benita <ran@unusedvar.com>
Discussion: https://postgr.es/m/a3383211-4539-459b-9d51-95c736ef08e0@app.fastmail.com
Backpatch-through: 14

Files

PathChange+/−
src/interfaces/libpq/fe-trace.c modified +2 −2

Discussion