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

@ -106,9 +106,9 @@ static int ctl_peer_parse_properties(struct ctl_peer *p,
const char *t, *p2p_mac = NULL, *friendly_name = NULL;
const char *interface = NULL, *local_address = NULL;
const char *remote_address = NULL, *wfd_subelements = NULL;
bool connected, connected_set = false;
bool connected_set = false;
char *tmp;
int r;
int connected, r;
if (!p || !m)
return cli_EINVAL();
@ -413,9 +413,9 @@ static int ctl_link_parse_properties(struct ctl_link *l,
const char *t, *interface_name = NULL, *friendly_name = NULL;
const char *wfd_subelements = NULL;
unsigned int interface_index = 0;
bool p2p_scanning, p2p_scanning_set = false;
bool p2p_scanning_set = false;
char *tmp;
int r;
int p2p_scanning, r;
if (!l || !m)
return cli_EINVAL();

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)