From b66a3f362f9bbf6a23873b245577e87beae183d6 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 1 Jan 2023 13:33:46 +0100 Subject: pids: Fix pointer arithmetic --- utils/pids.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/pids.c b/utils/pids.c index 44cd0b44..59646a5a 100644 --- a/utils/pids.c +++ b/utils/pids.c @@ -57,7 +57,7 @@ add_fn_pids (pid_t **pids, size_t *num_pids, unsigned id, pid_t *new = realloc (*pids, new_sz * sizeof (pid_t)); if (new) { - bcopy (new_pids, new + (*num_pids * sizeof (pid_t)), + bcopy (new_pids, new + *num_pids, num_new_pids * sizeof (pid_t)); *pids = new; *num_pids = new_sz; -- cgit v1.2.3