1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

dbus: use 'int' instead of 'bool' in sd_bus

sd_bus never uses 'bool', and given the weird implicit type promotions, it
is totally right to do so. Make sure we never pass pointers to 'bool' to
va_arg sd_bus functions to avoid overwriting stack space.

Signed-off-by: Andrey Gusakov <adnrey.gusakov@cogentembedded.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
Andrey Gusakov 2014-06-23 09:55:51 +04:00 committed by David Herrmann
parent 97323d905c
commit 2a84a2d868
2 changed files with 5 additions and 7 deletions

View file

@ -20,7 +20,6 @@
#define LOG_SUBSYSTEM "dbus"
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <systemd/sd-bus.h>
@ -558,8 +557,7 @@ static int link_dbus_set_p2p_scanning(sd_bus *bus,
sd_bus_error *err)
{
struct link *l = data;
bool val;
int r;
int val, r;
r = sd_bus_message_read(value, "b", &val);
if (r < 0)