diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2021-12-13 17:30:58 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2021-12-13 16:41:03 -0600 |
commit | d4fa3aaed31f515bd1986c8795c1ff52af26f202 (patch) | |
tree | c22a3827a0a64c167e8ce4621fae922e45052064 /bus | |
parent | 2baac0d54c4bec2c89de190b5df425826461ca86 (diff) | |
download | at-spi2-core-d4fa3aaed31f515bd1986c8795c1ff52af26f202.tar.gz |
Future-proof the count of source_fds / target_fds
Thanks to Philip Withnall for the suggestions.
Diffstat (limited to 'bus')
-rw-r--r-- | bus/at-spi-bus-launcher.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 23a258d5..77d71647 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -353,6 +353,7 @@ ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path) char *argv[] = { DBUS_DAEMON, config_path, "--nofork", "--print-address", print_address_fd_param, address_param, NULL }; gint source_fds[1] = { app->pipefd[1] }; gint target_fds[1] = { app->pipefd[1] }; + G_STATIC_ASSERT (G_N_ELEMENTS (source_fds) == G_N_ELEMENTS (target_fds)); GPid pid; char addr_buf[2048]; GError *error = NULL; @@ -371,7 +372,7 @@ ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path) -1, /* stdout_fd */ source_fds, target_fds, - 1, /* n_fds in source_fds and target_fds */ + G_N_ELEMENTS (source_fds), /* n_fds in source_fds and target_fds */ &pid, NULL, /* stdin_pipe_out */ NULL, /* stdout_pipe_out */ |