summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/dht.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/normal/dht.c')
-rw-r--r--src/ipcpd/normal/dht.c4
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;