summaryrefslogtreecommitdiff
path: root/other/bootstrap_node_packets.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-09-18 01:31:55 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-09-24 21:53:50 +0100
commit15cb4261665bab4ef02a5b1b9db48b9477c9b87a (patch)
treed0c40a45afa19fff26ce1eb5bb703e18a9acdd4a /other/bootstrap_node_packets.c
parent0d347c2b2e69aa09b079f6daaa00007fef4fe52f (diff)
Make toxcore code C++ compatible.
It is still C code, so still compatible with C compilers as well. This change lets us see more clearly where implicit conversions occur by making them explicit.
Diffstat (limited to 'other/bootstrap_node_packets.c')
-rw-r--r--other/bootstrap_node_packets.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/other/bootstrap_node_packets.c b/other/bootstrap_node_packets.c
index 8ee26786..8abbb7f2 100644
--- a/other/bootstrap_node_packets.c
+++ b/other/bootstrap_node_packets.c
@@ -40,13 +40,15 @@ static int handle_info_request(void *object, IP_Port source, const uint8_t *pack
40 return 1; 40 return 1;
41 } 41 }
42 42
43 Networking_Core *nc = (Networking_Core *)object;
44
43 uint8_t data[1 + sizeof(bootstrap_version) + MAX_MOTD_LENGTH]; 45 uint8_t data[1 + sizeof(bootstrap_version) + MAX_MOTD_LENGTH];
44 data[0] = BOOTSTRAP_INFO_PACKET_ID; 46 data[0] = BOOTSTRAP_INFO_PACKET_ID;
45 memcpy(data + 1, &bootstrap_version, sizeof(bootstrap_version)); 47 memcpy(data + 1, &bootstrap_version, sizeof(bootstrap_version));
46 uint16_t len = 1 + sizeof(bootstrap_version) + bootstrap_motd_length; 48 uint16_t len = 1 + sizeof(bootstrap_version) + bootstrap_motd_length;
47 memcpy(data + 1 + sizeof(bootstrap_version), bootstrap_motd, bootstrap_motd_length); 49 memcpy(data + 1 + sizeof(bootstrap_version), bootstrap_motd, bootstrap_motd_length);
48 50
49 if (sendpacket(object, source, data, len) == len) { 51 if (sendpacket(nc, source, data, len) == len) {
50 return 0; 52 return 0;
51 } 53 }
52 54