summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 6ff7e295..1edc86ae 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -100,10 +100,12 @@ int id_closest(const uint8_t *pk, const uint8_t *pk1, const uint8_t *pk2)
100 100
101 if (i == (crypto_box_PUBLICKEYBYTES - 1)) { 101 if (i == (crypto_box_PUBLICKEYBYTES - 1)) {
102 if (d1_abs) 102 if (d1_abs)
103 ++distance1; 103 if (distance1 != UINT8_MAX)
104 ++distance1;
104 105
105 if (d2_abs) 106 if (d2_abs)
106 ++distance2; 107 if (distance2 != UINT8_MAX)
108 ++distance2;
107 } 109 }
108 110
109 if (distance1 < distance2) 111 if (distance1 < distance2)