summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-09-29 08:07:10 -0400
committerirungentoo <irungentoo@gmail.com>2013-09-29 08:07:10 -0400
commit9f1080f8b4c753d12a04abf91d08092d4ae6ad1a (patch)
treeea5f96e7f0ed1e512f8ccc71144502c300bde0ee /toxcore
parentaae9fae257bb3948a1c5d51f939b25516b54c3ff (diff)
Fixed connection bug.
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/Lossless_UDP.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/Lossless_UDP.c b/toxcore/Lossless_UDP.c
index 7eb8fa64..53cdea09 100644
--- a/toxcore/Lossless_UDP.c
+++ b/toxcore/Lossless_UDP.c
@@ -44,7 +44,7 @@
44int getconnection_id(Lossless_UDP *ludp, IP_Port ip_port) 44int getconnection_id(Lossless_UDP *ludp, IP_Port ip_port)
45{ 45{
46 tox_array_for_each(&ludp->connections, Connection, tmp) { 46 tox_array_for_each(&ludp->connections, Connection, tmp) {
47 if (tmp-> status > 0 && ipport_equal(&tmp->ip_port, &ip_port)) { 47 if (tmp->status > 0 && ipport_equal(&tmp->ip_port, &ip_port)) {
48 return tmp_i; 48 return tmp_i;
49 } 49 }
50 } 50 }
@@ -322,7 +322,7 @@ static void free_connections(Lossless_UDP *ludp)
322 uint32_t i; 322 uint32_t i;
323 323
324 for (i = ludp->connections.len; i != 0; --i) { 324 for (i = ludp->connections.len; i != 0; --i) {
325 Connection *connection = &tox_array_get(&ludp->connections, i, Connection); 325 Connection *connection = &tox_array_get(&ludp->connections, i - 1, Connection);
326 326
327 if (connection->status != 0) 327 if (connection->status != 0)
328 break; 328 break;