diff options
-rw-r--r-- | toxcore/TCP_client.c | 2 | ||||
-rw-r--r-- | toxcore/TCP_server.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c index 2a2289b2..dbcae11b 100644 --- a/toxcore/TCP_client.c +++ b/toxcore/TCP_client.c | |||
@@ -165,7 +165,7 @@ static int write_packet_TCP_secure_connection(TCP_Client_Connection *con, const | |||
165 | if ((unsigned int)len == sizeof(packet)) | 165 | if ((unsigned int)len == sizeof(packet)) |
166 | return 1; | 166 | return 1; |
167 | 167 | ||
168 | memcpy(con->last_packet, packet, length); | 168 | memcpy(con->last_packet, packet, sizeof(packet)); |
169 | con->last_packet_length = sizeof(packet); | 169 | con->last_packet_length = sizeof(packet); |
170 | con->last_packet_sent = len; | 170 | con->last_packet_sent = len; |
171 | return 1; | 171 | return 1; |
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c index 6c0133dd..e7ef0d3a 100644 --- a/toxcore/TCP_server.c +++ b/toxcore/TCP_server.c | |||
@@ -345,7 +345,7 @@ static int write_packet_TCP_secure_connection(TCP_Secure_Connection *con, const | |||
345 | if ((unsigned int)len == sizeof(packet)) | 345 | if ((unsigned int)len == sizeof(packet)) |
346 | return 1; | 346 | return 1; |
347 | 347 | ||
348 | memcpy(con->last_packet, packet, length); | 348 | memcpy(con->last_packet, packet, sizeof(packet)); |
349 | con->last_packet_length = sizeof(packet); | 349 | con->last_packet_length = sizeof(packet); |
350 | con->last_packet_sent = len; | 350 | con->last_packet_sent = len; |
351 | return 1; | 351 | return 1; |