diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-07-29 17:28:46 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-07-29 18:45:32 +0200 |
commit | 396cd99e3bc51bbc23387259da028d109349374c (patch) | |
tree | a30f99b02b460edeb2f3db094f89a431eddfa1f6 /src/ipcpd | |
parent | 7407c7e21d2f50481bb81f36ee933094299aea1f (diff) | |
download | ouroboros-396cd99e3bc51bbc23387259da028d109349374c.tar.gz ouroboros-396cd99e3bc51bbc23387259da028d109349374c.zip |
ipcpd: Fix registration bug in DHT
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/normal/dht.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ipcpd/normal/dht.c b/src/ipcpd/normal/dht.c index 9072ee5a..74618658 100644 --- a/src/ipcpd/normal/dht.c +++ b/src/ipcpd/normal/dht.c @@ -1357,7 +1357,7 @@ static int kad_add(struct dht * dht, pthread_rwlock_wrlock(&dht->lock); - while (--n >= 0) { + while (n-- > 0) { if (contacts[n].id.len != dht->b) log_warn("Bad key length in contact data."); @@ -1557,7 +1557,7 @@ static void kad_publish(struct dht * dht, n = lookup_contact_addrs(lu, addrs); - while (--n > 0) { + while (n-- > 0) { if (addrs[n] == dht->addr) { kad_contact_msg_t msg = KAD_CONTACT_MSG__INIT; msg.id.data = (uint8_t *) key; |