From: Martin Ling Date: Fri, 24 Jan 2020 06:24:59 +0000 (+0000) Subject: Fix use of variable length local array in await_events example. X-Git-Tag: libserialport-0.1.2~36 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d8c4d388e83085af859ab2a322707dceb6ac700d;p=libserialport.git Fix use of variable length local array in await_events example. This prevented building with MSVC. --- 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;