summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
authorzugz (tox) <mbays+tox@sdf.org>2020-02-28 00:00:00 +0000
committerzugz (tox) <mbays+tox@sdf.org>2020-03-14 00:00:02 +0000
commitc644ef76810f8db61bce3f52d36a1a6a25e47683 (patch)
tree1a4c5ed13f1a3450e3a005746ba6bb0d1af7beaf /toxcore/DHT.c
parente6714909898d7e5fe6b35b6d109e584e6c5858b0 (diff)
use -1 rather than ~0 in unsigned integer types
Using ~0 involves a bitwise operation on int, so depends on the internal representation of signed integers.
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 79925552..8603b9c0 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -247,7 +247,7 @@ static unsigned int bit_by_bit_cmp(const uint8_t *pk1, const uint8_t *pk2)
247void get_shared_key(const Mono_Time *mono_time, Shared_Keys *shared_keys, uint8_t *shared_key, 247void get_shared_key(const Mono_Time *mono_time, Shared_Keys *shared_keys, uint8_t *shared_key,
248 const uint8_t *secret_key, const uint8_t *public_key) 248 const uint8_t *secret_key, const uint8_t *public_key)
249{ 249{
250 uint32_t num = ~0; 250 uint32_t num = -1;
251 uint32_t curr = 0; 251 uint32_t curr = 0;
252 252
253 for (uint32_t i = 0; i < MAX_KEYS_PER_SLOT; ++i) { 253 for (uint32_t i = 0; i < MAX_KEYS_PER_SLOT; ++i) {