Fix use of variable length local array in await_events example.

This prevented building with MSVC.
This commit is contained in:
Martin Ling 2020-01-24 06:24:59 +00:00 committed by Uwe Hermann
parent d6412d2801
commit d8c4d388e8
1 changed files with 3 additions and 1 deletions

View File

@ -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;