diff options
author | iphydf <iphydf@users.noreply.github.com> | 2020-05-05 22:28:59 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2020-05-05 22:56:35 +0100 |
commit | 48bd200acbf4b4d8f3fa241373477b3a21001d17 (patch) | |
tree | 732cd71532990452c9d7c07920265ed272f3e6c9 /toxcore/Messenger.c | |
parent | c1a2ea3309969608a5553c34fa4199b05f20abc2 (diff) |
refactor: Disallow multiple initialised declarators per decl.
We no longer allow:
```c
int a = 0, b = 0;
int a[3], b[3];
int a, *b;
```
But we do still allow (for now):
```c
int a, b;
```
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 3 |
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) { |