From d8c4d388e83085af859ab2a322707dceb6ac700d Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Fri, 24 Jan 2020 06:24:59 +0000 Subject: [PATCH] Fix use of variable length local array in await_events example. This prevented building with MSVC. --- examples/await_events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/await_events.c b/examples/await_events.c index 133d899..672d531 100644 --- a/examples/await_events.c +++ b/examples/await_events.c @@ -20,7 +20,9 @@ int main(int argc, char **argv) char **port_names = argv + 1; /* The ports we will use. */ - struct sp_port *ports[num_ports]; + struct sp_port **ports = malloc(num_ports * sizeof(struct sp_port *)); + if (!ports) + abort(); /* The set of events we will wait for. */ struct sp_event_set *event_set;