summaryrefslogtreecommitdiffstats
path: root/src/test/test-nss-hosts.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-08-30 09:28:56 +0200
committerJan Janssen <medhefgo@web.de>2022-08-30 12:03:33 +0200
commit5570a09702b2a4c77772617d5fce97b6b70ec03f (patch)
tree6894fe53f7ed84cce0f20d1190648e0797ca8023 /src/test/test-nss-hosts.c
parenttree-wide: Fix a some remaining format warnings by casting (diff)
downloadsystemd-5570a09702b2a4c77772617d5fce97b6b70ec03f.tar.xz
systemd-5570a09702b2a4c77772617d5fce97b6b70ec03f.zip
tree-wide: Fix format specifier warnings for %x
Unfortunately, hex output can only be produced with unsigned types. Some cases can be fixed by producing the correct type, but a few simply have to be cast. At least casting makes it explicit.
Diffstat (limited to 'src/test/test-nss-hosts.c')
-rw-r--r--src/test/test-nss-hosts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-nss-hosts.c b/src/test/test-nss-hosts.c
index c361df1632..defecd3a51 100644
--- a/src/test/test-nss-hosts.c
+++ b/src/test/test-nss-hosts.c
@@ -114,10 +114,10 @@ static void test_gethostbyname4_r(void *handle, const char *module, const char *
status = f(name, &pat, buffer, sizeof buffer, &errno1, &errno2, &ttl);
if (status == NSS_STATUS_SUCCESS) {
- log_info("%s(\"%s\") → status=%s%-20spat=buffer+0x%tx errno=%d/%s h_errno=%d/%s ttl=%"PRIi32,
+ log_info("%s(\"%s\") → status=%s%-20spat=buffer+0x%"PRIxPTR" errno=%d/%s h_errno=%d/%s ttl=%"PRIi32,
fname, name,
nss_status_to_string(status, pretty_status, sizeof pretty_status), "\n",
- pat ? (char*) pat - buffer : 0,
+ pat ? (uintptr_t) pat - (uintptr_t) buffer : 0,
errno1, errno_to_name(errno1) ?: "---",
errno2, hstrerror(errno2),
ttl);