Fix test_many_clients in tox_test

Stack variable to_comp goes out of scope,
but a reference to the variable is used later
in Fiend_Requests.
This commit is contained in:
pyruvate 2014-07-28 02:54:43 +03:00
parent 8aa62cfef7
commit 87dd6becf7

View File

@ -294,11 +294,11 @@ START_TEST(test_many_clients)
long long unsigned int cur_time = time(NULL); long long unsigned int cur_time = time(NULL);
Tox *toxes[NUM_TOXES]; Tox *toxes[NUM_TOXES];
uint32_t i, j; uint32_t i, j;
uint32_t to_comp = 974536;
for (i = 0; i < NUM_TOXES; ++i) { for (i = 0; i < NUM_TOXES; ++i) {
toxes[i] = tox_new(TOX_ENABLE_IPV6_DEFAULT); toxes[i] = tox_new(TOX_ENABLE_IPV6_DEFAULT);
ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i); ck_assert_msg(toxes[i] != 0, "Failed to create tox instances %u", i);
uint32_t to_comp = 974536;
tox_callback_friend_request(toxes[i], accept_friend_request, &to_comp); tox_callback_friend_request(toxes[i], accept_friend_request, &to_comp);
} }