From 592cd40af8d4ae3a33654aa5e1106287ecb591bc Mon Sep 17 00:00:00 2001 From: Erkhes N <71805796+rexes-ND@users.noreply.github.com> Date: Thu, 1 Jul 2021 12:24:35 +0900 Subject: [PATCH] test: wrong pointer arithmetic multiplier PR-URL: https://github.com/libuv/libuv/pull/3216 Reviewed-By: Ben Noordhuis Reviewed-By: Jameson Nash --- test/runner-unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runner-unix.c b/test/runner-unix.c index b7ca1f85..a13648bc 100644 --- a/test/runner-unix.c +++ b/test/runner-unix.c @@ -197,7 +197,7 @@ static void* dowait(void* data) { process_info_t* p; for (i = 0; i < args->n; i++) { - p = (process_info_t*)(args->vec + i * sizeof(process_info_t)); + p = &args->vec[i]; if (p->terminated) continue; r = waitpid(p->pid, &p->status, 0); if (r < 0) { @@ -323,7 +323,7 @@ int process_wait(process_info_t* vec, int n, int timeout) { } else { /* Timeout. Kill all the children. */ for (i = 0; i < n; i++) { - p = (process_info_t*)(vec + i * sizeof(process_info_t)); + p = &vec[i]; kill(p->pid, SIGTERM); } retval = -2;