diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-23 01:13:09 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-23 01:17:55 +0100 |
commit | 6cd37a5e59e01f4a2b3f02d9746b3e7417d424e6 (patch) | |
tree | fd888d2fe6a3c446854f44a405c4cb3720afb74e /src/libsystemd/sd-bus/bus-message.c | |
parent | e026c242af5b724da53e4944aab2645547644cf7 (diff) |
sd-bus: fix handling of double parameters in sd_bus_message_append()
We really need to use va_arg() with the right type here as uint64_t and
double might have the same size, but are passed differently as
arguments.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-message.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index 23076d25dd..9ae65bebc8 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -2350,8 +2350,7 @@ int bus_message_append_ap( } case SD_BUS_TYPE_INT64: - case SD_BUS_TYPE_UINT64: - case SD_BUS_TYPE_DOUBLE: { + case SD_BUS_TYPE_UINT64: { uint64_t x; x = va_arg(ap, uint64_t); @@ -2359,6 +2358,14 @@ int bus_message_append_ap( break; } + case SD_BUS_TYPE_DOUBLE: { + double x; + + x = va_arg(ap, double); + r = sd_bus_message_append_basic(m, *t, &x); + break; + } + case SD_BUS_TYPE_STRING: case SD_BUS_TYPE_OBJECT_PATH: case SD_BUS_TYPE_SIGNATURE: { |