Skip to content

Commit

Permalink
Use variable length array macro
Browse files Browse the repository at this point in the history
  • Loading branch information
bretambrose committed Dec 5, 2024
1 parent 5bf5f7a commit 2ab7cdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/native/mqtt_request_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ JNIEXPORT void JNICALL
AWS_ZERO_STRUCT(request_options);

size_t subscription_count = aws_array_list_length(&request_params.subscriptions);
struct aws_byte_cursor subscriptions[subscription_count];
AWS_VARIABLE_LENGTH_ARRAY(struct aws_byte_cursor, subscriptions, subscription_count);
for (size_t i = 0; i < subscription_count; ++i) {
struct aws_jni_subscription subscription;
AWS_ZERO_STRUCT(subscription);
Expand All @@ -521,7 +521,7 @@ JNIEXPORT void JNICALL
}

size_t response_path_count = aws_array_list_length(&request_params.response_paths);
struct aws_mqtt_request_operation_response_path response_paths[response_path_count];
AWS_VARIABLE_LENGTH_ARRAY(struct aws_mqtt_request_operation_response_path, response_paths, response_path_count);
for (size_t i = 0; i < response_path_count; ++i) {
struct aws_jni_response_path response_path;
AWS_ZERO_STRUCT(response_path);
Expand Down

0 comments on commit 2ab7cdf

Please sign in to comment.