diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-06-05 10:10:09 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-06-05 12:49:26 -0400 |
commit | 5571004b697944d7c6c7d9207ce6818ebaa1bf00 (patch) | |
tree | 9cb32c45e70cbbbcd31d8964975a68d0baa80959 | |
parent | 304c6ce93478d314461eae43dc6c673a2a4f74a0 (diff) | |
download | rneovim-5571004b697944d7c6c7d9207ce6818ebaa1bf00.tar.gz rneovim-5571004b697944d7c6c7d9207ce6818ebaa1bf00.tar.bz2 rneovim-5571004b697944d7c6c7d9207ce6818ebaa1bf00.zip |
fixup! tests: fix system_spec when run with clipboard manager (#10956)
uv_process_options_t "args" member was set to a local array from stack.
when uv_process_options_t variable is outside the function.
https://pvs-studio.com/en/docs/warnings/v507/
-rw-r--r-- | test/functional/fixtures/streams-test.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/functional/fixtures/streams-test.c b/test/functional/fixtures/streams-test.c index eec447153c..be40edfe7e 100644 --- a/test/functional/fixtures/streams-test.c +++ b/test/functional/fixtures/streams-test.c @@ -6,23 +6,22 @@ #include <uv.h> -uv_loop_t *loop; -uv_process_t child_req; -uv_process_options_t options; - int main(int argc, char **argv) { - loop = uv_default_loop(); + uv_loop_t *loop = uv_default_loop(); + uv_process_t child_req; char * args[3]; args[0] = "sleep"; args[1] = "10"; args[2] = NULL; - options.exit_cb = NULL; - options.file = "sleep"; - options.args = args; - options.flags = UV_PROCESS_DETACHED; + uv_process_options_t options = { + .exit_cb = NULL, + .file = "sleep", + .args = args, + .flags = UV_PROCESS_DETACHED, + }; int r; if ((r = uv_spawn(loop, &child_req, &options))) { |