summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-message.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-10-22 03:27:38 +0200
committerKay Sievers <kay@vrfy.org>2013-10-22 03:35:45 +0200
commit9bcbce4201afada1c0ad8ada0cbfbbf58a52a6a7 (patch)
tree6711cfcec9e2d25dae74a3d04e9093e2cdfdcec0 /src/libsystemd-bus/bus-message.c
parent40976028c6f24b9934e6c797ef6f5e123ac520d5 (diff)
bus: avoid 'bool' storage when retrieving 'b' from the message
Just use an unsigned int as a bool type to avoid issues in the public message reading API; sizeof(bool) == 1, but the code copies 4 bytes at the pointers destination.
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r--src/libsystemd-bus/bus-message.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 511bdf503e..cfc45a3f71 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -2741,7 +2741,7 @@ int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) {
break;
case SD_BUS_TYPE_BOOLEAN:
- *(int*) p = !!*(uint32_t*) q;
+ *(unsigned*) p = !!*(uint32_t*) q;
break;
case SD_BUS_TYPE_INT16: