From b2d04eae9d9b76523b877a9e5efd5989f83b143d Mon Sep 17 00:00:00 2001 From: Maxim Biro Date: Sun, 19 Feb 2017 21:24:30 -0500 Subject: [PATCH] Use VLA macro --- toxcore/DHT.c | 2 +- toxcore/onion_announce.c | 2 +- toxcore/onion_client.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toxcore/DHT.c b/toxcore/DHT.c index dfd4d821..7064d3d5 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c @@ -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; diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c index 28d3b281..85868b91 100644 --- a/toxcore/onion_announce.c +++ b/toxcore/onion_announce.c @@ -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; diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 58ac8e0d..ddae84e5 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -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;