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/DHT.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/DHT.c')
-rw-r--r-- | toxcore/DHT.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 7c9263cd..40f477fd 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -583,7 +583,8 @@ int pack_nodes(uint8_t *data, uint16_t length, const Node_format *nodes, uint16_ | |||
583 | int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed_data_len, const uint8_t *data, | 583 | int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed_data_len, const uint8_t *data, |
584 | uint16_t length, bool tcp_enabled) | 584 | uint16_t length, bool tcp_enabled) |
585 | { | 585 | { |
586 | uint32_t num = 0, len_processed = 0; | 586 | uint32_t num = 0; |
587 | uint32_t len_processed = 0; | ||
587 | 588 | ||
588 | while (num < max_num_nodes && len_processed < length) { | 589 | while (num < max_num_nodes && len_processed < length) { |
589 | const int ipp_size = unpack_ip_port(&nodes[num].ip_port, data + len_processed, length - len_processed, tcp_enabled); | 590 | const int ipp_size = unpack_ip_port(&nodes[num].ip_port, data + len_processed, length - len_processed, tcp_enabled); |