From 8fa264e7709d64377f688fc9efce528ebd75618f Mon Sep 17 00:00:00 2001 From: irungentoo Date: Wed, 9 Dec 2015 09:10:03 -0500 Subject: [PATCH] Small fix. --- toxcore/DHT.c | 6 ++++-- 1 file 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) if (i == (crypto_box_PUBLICKEYBYTES - 1)) { if (d1_abs) - ++distance1; + if (distance1 != UINT8_MAX) + ++distance1; if (d2_abs) - ++distance2; + if (distance2 != UINT8_MAX) + ++distance2; } if (distance1 < distance2)