diff options
author | iphydf <iphydf@users.noreply.github.com> | 2020-05-05 22:56:03 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2020-05-05 23:22:29 +0100 |
commit | 8c0fd40356e4a7724b556e17b15b0d14f7d25b4d (patch) | |
tree | 489599830b083d5705c0b5d2c8fb31a43242f90c /toxcore/net_crypto.c | |
parent | fd2bb77923b68ec50e4812c9663eab42314d4557 (diff) |
refactor: Remove multi-declarators entirely.
We no longer allow `int a, b;`. In the few cases where we used it, we
instead better
* limit the scope of the identifier (e.g. in a for-init-decl)
* split the line and have 2 separate declarators, because the
identifiers designate different types of things (e.g. friend numbers
and group numbers).
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r-- | toxcore/net_crypto.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 3ed46a99..43cc8ab1 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c | |||
@@ -1512,7 +1512,8 @@ static int handle_data_packet_core(Net_Crypto *c, int crypt_connection_id, const | |||
1512 | return -1; | 1512 | return -1; |
1513 | } | 1513 | } |
1514 | 1514 | ||
1515 | uint32_t buffer_start, num; | 1515 | uint32_t buffer_start; |
1516 | uint32_t num; | ||
1516 | memcpy(&buffer_start, data, sizeof(uint32_t)); | 1517 | memcpy(&buffer_start, data, sizeof(uint32_t)); |
1517 | memcpy(&num, data + sizeof(uint32_t), sizeof(uint32_t)); | 1518 | memcpy(&num, data + sizeof(uint32_t), sizeof(uint32_t)); |
1518 | buffer_start = net_ntohl(buffer_start); | 1519 | buffer_start = net_ntohl(buffer_start); |