[PATCH 3/5] site.c (we_have_priority): Fix unintended `&&'.
Mark Wooding
mdw at distorted.org.uk
Thu Sep 19 19:41:10 BST 2019
`CAPAB_PRIORITY_MOBILE' is 0x80000000, which is nonzero, so that doesn't
change the outcome. So the code is only checking whether the local and
remote capabilities overlap at all, which seems unhelpful.
Instead, check that both advertise `CAPAB_PRIORITY_MOBILE' here.
Spotted by Clang.
Signed-off-by: Mark Wooding <mdw at distorted.org.uk>
---
site.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/site.c b/site.c
index 4ec56df..d0dd909 100644
--- a/site.c
+++ b/site.c
@@ -1781,8 +1781,8 @@ static bool_t named_for_us(struct site *st, const struct buffer_if *buf_in,
}
static bool_t we_have_priority(struct site *st, const struct msg *m) {
- if ((st->local_capabilities & m->remote_capabilities)
- && CAPAB_PRIORITY_MOBILE) {
+ if (st->local_capabilities & m->remote_capabilities &
+ CAPAB_PRIORITY_MOBILE) {
if (st->local_mobile) return True;
if (st-> peer_mobile) return False;
}
--
[mdw]
More information about the sgo-software-discuss
mailing list