Skip to content
This repository was archived by the owner on Jul 18, 2019. It is now read-only.

Commit a1e2ef7

Browse files
authored
Revert "sd-bus: use PRIu64 instead of casting" (systemd#4556)
This reverts commit 75ead2b. Follow up for systemd#4546: > @@ -848,8 +848,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { if (k->src_id == KDBUS_SRC_ID_KERNEL) bus_message_set_sender_driver(bus, m); else { - xsprintf(m->sender_buffer, ":1.%llu", - (unsigned long long)k->src_id); + xsprintf(m->sender_buffer, ":1.%"PRIu64, k->src_id); This produces: src/libsystemd/sd-bus/bus-kernel.c: In function ‘bus_kernel_make_message’: src/libsystemd/sd-bus/bus-kernel.c:851:44: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘__u64 {aka long long unsigned int}’ [-Wformat=] xsprintf(m->sender_buffer, ":1.%"PRIu64, k->src_id); ^
1 parent c14eff3 commit a1e2ef7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libsystemd/sd-bus/bus-kernel.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,8 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
848848
if (k->src_id == KDBUS_SRC_ID_KERNEL)
849849
bus_message_set_sender_driver(bus, m);
850850
else {
851-
xsprintf(m->sender_buffer, ":1.%"PRIu64, k->src_id);
851+
xsprintf(m->sender_buffer, ":1.%llu",
852+
(unsigned long long)k->src_id);
852853
m->sender = m->creds.unique_name = m->sender_buffer;
853854
}
854855

@@ -859,7 +860,8 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
859860
else if (k->dst_id == KDBUS_DST_ID_NAME)
860861
m->destination = bus->unique_name; /* fill in unique name if the well-known name is missing */
861862
else {
862-
xsprintf(m->destination_buffer, ":1.%"PRIu64, k->dst_id);
863+
xsprintf(m->destination_buffer, ":1.%llu",
864+
(unsigned long long)k->dst_id);
863865
m->destination = m->destination_buffer;
864866
}
865867

0 commit comments

Comments
 (0)