summaryrefslogtreecommitdiff
path: root/toxcore/Messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r--toxcore/Messenger.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index 32c89867..573cd64a 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -239,7 +239,8 @@ int32_t m_addfriend(Messenger *m, const uint8_t *address, const uint8_t *data, u
239 return FAERR_BADCHECKSUM; 239 return FAERR_BADCHECKSUM;
240 } 240 }
241 241
242 uint16_t check, checksum = address_checksum(address, FRIEND_ADDRESS_SIZE - sizeof(checksum)); 242 uint16_t check;
243 uint16_t checksum = address_checksum(address, FRIEND_ADDRESS_SIZE - sizeof(checksum));
243 memcpy(&check, address + CRYPTO_PUBLIC_KEY_SIZE + sizeof(uint32_t), sizeof(check)); 244 memcpy(&check, address + CRYPTO_PUBLIC_KEY_SIZE + sizeof(uint32_t), sizeof(check));
244 245
245 if (check != checksum) { 246 if (check != checksum) {