Use VLA macro

This commit is contained in:
Maxim Biro 2017-02-19 21:24:30 -05:00
parent 1cc119c7a3
commit b2d04eae9d
3 changed files with 3 additions and 3 deletions

View File

@ -867,7 +867,7 @@ static void sort_client_list(Client_data *list, unsigned int length, const uint8
{
// Pass comp_public_key to qsort with each Client_data entry, so the
// comparison function can use it as the base of comparison.
Cmp_data cmp_list[length];
VLA(Cmp_data, cmp_list, length);
for (uint32_t i = 0; i < length; i++) {
cmp_list[i].base_public_key = comp_public_key;

View File

@ -279,7 +279,7 @@ static void sort_onion_announce_list(Onion_Announce_Entry *list, unsigned int le
{
// Pass comp_public_key to qsort with each Client_data entry, so the
// comparison function can use it as the base of comparison.
Cmp_data cmp_list[length];
VLA(Cmp_data, cmp_list, length);
for (uint32_t i = 0; i < length; i++) {
cmp_list[i].base_public_key = comp_public_key;

View File

@ -517,7 +517,7 @@ static void sort_onion_node_list(Onion_Node *list, unsigned int length, const ui
{
// Pass comp_public_key to qsort with each Client_data entry, so the
// comparison function can use it as the base of comparison.
Cmp_data cmp_list[length];
VLA(Cmp_data, cmp_list, length);
for (uint32_t i = 0; i < length; i++) {
cmp_list[i].base_public_key = comp_public_key;