From: Niklas Hofmann Date: Wed, 13 Aug 2014 07:27:05 +0000 (+0200) Subject: fixing comparison expression X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=eab78f4d460ec17b44978ce4cca02daadacca9c0;p=meshlink fixing comparison expression --- diff --git a/src/net.c b/src/net.c index a528eb43..c33c69c3 100644 --- a/src/net.c +++ b/src/net.c @@ -374,7 +374,7 @@ static void periodic_handler(event_loop_t *loop, void *data) { // find better nodes to connect to - if(!connect_to && min_connects <= cur_connects < max_connects) + if(!connect_to && min_connects <= cur_connects && cur_connects < max_connects) { unsigned int connects = 0; @@ -415,7 +415,7 @@ static void periodic_handler(event_loop_t *loop, void *data) { // heal partitions - if(!connect_to && min_connects <= cur_connects < max_connects) + if(!connect_to && min_connects <= cur_connects && cur_connects < max_connects) { splay_tree_t *nodes = splay_alloc_tree(node_compare_devclass_asc_last_connect_try_desc, NULL); @@ -462,7 +462,7 @@ static void periodic_handler(event_loop_t *loop, void *data) { // disconnect suboptimal outgoing connections - if(min_connects < cur_connects <= max_connects) + if(min_connects < cur_connects && cur_connects <= max_connects) { unsigned int connects = 0;