From c3c51563af63be8681b58fd6d378da792333ad26 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 5 Apr 2020 15:54:15 +0200 Subject: [PATCH] Avoid variable lengths arrays (#368) * Avoid variable lengths arrays Despite conforming to C99, variable length arrays are not supported by MSVC, and maybe some other relevant compilers. Therefore we hard-code the maximum required space. * Properly set custom_properties_table.num_entries --- amqp_connection_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amqp_connection_resource.c b/amqp_connection_resource.c index 10f4da20..dbe886d6 100644 --- a/amqp_connection_resource.c +++ b/amqp_connection_resource.c @@ -540,7 +540,7 @@ amqp_connection_resource *connection_resource_constructor(amqp_connection_params } custom_properties_table.entries = custom_properties_entries; - custom_properties_table.num_entries = sizeof(custom_properties_entries) / sizeof(amqp_table_entry_t); + custom_properties_table.num_entries = params->connection_name ? 2 : 1; /* We can assume that connection established here but it is not true, real handshake goes during login */